1*3117ece4Schristos#!/usr/bin/env sh 2*3117ece4Schristos 3*3117ece4Schristosset -e 4*3117ece4Schristos 5*3117ece4SchristosSCRIPT_DIR=$(cd "$(dirname "$0")" && pwd) 6*3117ece4SchristosINCLUDE_DIR="$SCRIPT_DIR/../linux/include" 7*3117ece4SchristosLIB_DIR="$SCRIPT_DIR/../linux/lib" 8*3117ece4Schristos 9*3117ece4Schristos 10*3117ece4Schristosprint() { 11*3117ece4Schristos printf '%b' "${*}" 12*3117ece4Schristos} 13*3117ece4Schristos 14*3117ece4Schristosprintln() { 15*3117ece4Schristos printf '%b\n' "${*}" 16*3117ece4Schristos} 17*3117ece4Schristos 18*3117ece4Schristosdie() { 19*3117ece4Schristos println "$@" 1>&2 20*3117ece4Schristos exit 1 21*3117ece4Schristos} 22*3117ece4Schristos 23*3117ece4Schristostest_not_present() { 24*3117ece4Schristos print "Testing that '$1' is not present... " 25*3117ece4Schristos grep -r $1 "$INCLUDE_DIR" "$LIB_DIR" && die "Fail!" 26*3117ece4Schristos println "Okay" 27*3117ece4Schristos} 28*3117ece4Schristos 29*3117ece4Schristosprintln "This test checks that the macro removal process worked as expected" 30*3117ece4Schristosprintln "If this test fails, then freestanding.py wasn't able to remove one of these" 31*3117ece4Schristosprintln "macros from the source code completely. You'll either need to rewrite the check" 32*3117ece4Schristosprintln "or improve freestanding.py." 33*3117ece4Schristosprintln "" 34*3117ece4Schristos 35*3117ece4Schristostest_not_present "ZSTD_NO_INTRINSICS" 36*3117ece4Schristostest_not_present "ZSTD_NO_UNUSED_FUNCTIONS" 37*3117ece4Schristostest_not_present "ZSTD_LEGACY_SUPPORT" 38*3117ece4Schristostest_not_present "STATIC_BMI2" 39*3117ece4Schristostest_not_present "ZSTD_DLL_EXPORT" 40*3117ece4Schristostest_not_present "ZSTD_DLL_IMPORT" 41*3117ece4Schristostest_not_present "__ICCARM__" 42*3117ece4Schristostest_not_present "_MSC_VER" 43*3117ece4Schristostest_not_present "_WIN32" 44*3117ece4Schristostest_not_present "__linux__" 45