]> git.notmuchmail.org Git - notmuch/commitdiff
test: add user-configurable TEST_READELF variable master
authorLucio Sauer <watermanpaint@posteo.net>
Fri, 27 Feb 2026 01:28:41 +0000 (01:28 +0000)
committerDavid Bremner <david@tethera.net>
Thu, 5 Mar 2026 23:52:19 +0000 (07:52 +0800)
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>
test/T000-basic.sh
test/T360-symbol-hiding.sh
test/test-vars.sh

index 642f918d20398c4b9b8f028183cfd10e130da5e8..774f2f5a81242eab17cf002e40b11654e6dcbda4 100755 (executable)
@@ -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
index ff06ff691b785c96bbe5762a247868d663685864..a75f743513312cd912e94c4c897b8bf63062875c 100755 (executable)
@@ -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
index 02d60f89a0ddb0200e37df95e661d22c03b0cebb..f30811a91a64866fd129030324e8a7cbf3403ef4 100644 (file)
@@ -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"}