From 6e21f1b4e2c580b64d258e3b81ac9e44d53b9283 Mon Sep 17 00:00:00 2001 From: Jia Tan Date: Fri, 14 Jul 2023 21:30:25 +0800 Subject: Tests: Improve feature testing for skipping. Fixed a bug where test_compress_* would all fail if arm64 or armthumb filters were enabled for compression but arm was disabled. Since the grep tests only checked for "define HAVE_ENCODER_ARM", this would match on HAVE_ENCODER_ARM64 or HAVE_ENCODER_ARMTHUMB. Now the config.h feature test requires " 1" at the end to prevent the prefix problem. have_feature() was also updated for this even though there were known current bugs affecting it. This is just in case future features have a similar prefix problem. --- tests/test_files.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/test_files.sh') diff --git a/tests/test_files.sh b/tests/test_files.sh index 64d73081..e42af918 100755 --- a/tests/test_files.sh +++ b/tests/test_files.sh @@ -35,7 +35,7 @@ fi EXIT_STATUS=0 have_feature() { - grep "define HAVE_$1" ../config.h > /dev/null && return 0 + grep "define HAVE_$1 1" ../config.h > /dev/null && return 0 printf '%s: Skipping because HAVE_%s is not enabled\n' "$2" "$1" EXIT_STATUS=77 return 1 -- cgit v1.2.3