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>
"$(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
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
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"}