aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucio Sauer <watermanpaint@posteo.net>2026-02-27 01:28:41 +0000
committerDavid Bremner <david@tethera.net>2026-03-06 07:52:19 +0800
commite211ccc9317b67102c6d8d3f6e2f2737e93388f7 (patch)
tree8ea1dfdd2989fbbec8bff2bf1835748ccd4934d0
parentbcb1398cdc2bf7d8fab0223b6cb008b7959e0780 (diff)
test: add user-configurable TEST_READELF variable
This allows tests to pass on systems where the readelf executable is prefixed with a target triple. Signed-off-by: Lucio Sauer <watermanpaint@posteo.net>
-rwxr-xr-xtest/T000-basic.sh2
-rwxr-xr-xtest/T360-symbol-hiding.sh2
-rw-r--r--test/test-vars.sh1
3 files changed, 3 insertions, 2 deletions
diff --git a/test/T000-basic.sh b/test/T000-basic.sh
index 642f918d..774f2f5a 100755
--- a/test/T000-basic.sh
+++ b/test/T000-basic.sh
@@ -72,7 +72,7 @@ test_expect_equal \
"$(echo $PATH|cut -f1 -d: | sed -e 's,/test/valgrind/bin$,,')"
test_begin_subtest 'notmuch is compiled with debugging symbols'
-readelf --sections $(command -v notmuch) | grep \.debug
+${TEST_READELF} --sections $(command -v notmuch) | grep \.debug
test_expect_equal 0 $?
test_done
diff --git a/test/T360-symbol-hiding.sh b/test/T360-symbol-hiding.sh
index ff06ff69..a75f7435 100755
--- a/test/T360-symbol-hiding.sh
+++ b/test/T360-symbol-hiding.sh
@@ -30,7 +30,7 @@ test_begin_subtest 'checking output'
test_expect_equal "$result" "$output"
test_begin_subtest 'comparing existing to exported symbols'
-readelf -Ws $NOTMUCH_BUILDDIR/lib/libnotmuch.so | sed -e 's/\[[^]]*\]//' |\
+${TEST_READELF} -Ws $NOTMUCH_BUILDDIR/lib/libnotmuch.so | sed -e 's/\[[^]]*\]//' |\
awk '$4 == "FUNC" && $5 == "GLOBAL" && $7 != "UND" {print $8}' | sort -u > ACTUAL
sed -n 's/^\(notmuch_[a-zA-Z0-9_]*\)[[:blank:]]*(.*/\1/p' $NOTMUCH_SRCDIR/lib/notmuch.h | sort -u > EXPORTED
test_expect_equal_file EXPORTED ACTUAL
diff --git a/test/test-vars.sh b/test/test-vars.sh
index 02d60f89..f30811a9 100644
--- a/test/test-vars.sh
+++ b/test/test-vars.sh
@@ -32,6 +32,7 @@ TEST_EMACSCLIENT=${TEST_EMACSCLIENT:-emacsclient}
TEST_GDB=${TEST_GDB:-gdb}
TEST_CC=${TEST_CC:-cc}
TEST_CFLAGS=${TEST_CFLAGS:-"-g -O0"}
+TEST_READELF=${TEST_READELF:-readelf}
TEST_SHIM_CFLAGS=${TEST_SHIM_CFLAGS:-"-fpic -shared"}
TEST_SHIM_LDFLAGS=${TEST_SHIM_LDFLAGS:-"-ldl"}