mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-25 04:18:08 +01:00
c34d6bad0f
After yet another variation in objdump output caused this test to fail (on a Debian port, no less), I decided whatever putative benefit we get from looking at the object files instead of the library isn't worth the maintenence headache. This version uses nm -P. nm -P should be portable, and fixed format. It purposely doesn't use the -D argument, since that is non-POSIX and nm on GNU/Linux seems do the right thing without it. It still won't work out of the box on e.g. Mac OS/X. I think the right thing to do there is to move some more configuration information into sh.config.
33 lines
1.1 KiB
Bash
Executable file
33 lines
1.1 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
#
|
|
# Copyright (c) 2011 David Bremner
|
|
#
|
|
|
|
# This test tests whether hiding Xapian::Error symbols in libnotmuch
|
|
# also hides them for other users of libxapian. This is motivated by
|
|
# the discussion in http://gcc.gnu.org/wiki/Visibility'
|
|
|
|
test_description='exception symbol hiding'
|
|
|
|
. ./test-lib.sh
|
|
|
|
run_test(){
|
|
result=$(LD_LIBRARY_PATH="$TEST_DIRECTORY/../lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" $TEST_DIRECTORY/symbol-test 2>&1)
|
|
}
|
|
|
|
output="A Xapian exception occurred opening database: Couldn't stat 'fakedb/.notmuch/xapian'
|
|
caught No chert database found at path \`./nonexistant'"
|
|
|
|
mkdir -p fakedb/.notmuch
|
|
|
|
test_expect_success 'running test' run_test
|
|
|
|
test_begin_subtest 'checking output'
|
|
test_expect_equal "$result" "$output"
|
|
|
|
test_begin_subtest 'comparing existing to exported symbols'
|
|
nm -P $TEST_DIRECTORY/../lib/libnotmuch.so | awk '$2 == "T" && $1 ~ "^notmuch" {print $1}' | sort | uniq > ACTUAL
|
|
sed -n 's/[[:blank:]]*\(notmuch_[^;]*\);/\1/p' $TEST_DIRECTORY/../notmuch.sym | sort | uniq > EXPORTED
|
|
test_expect_equal_file EXPORTED ACTUAL
|
|
|
|
test_done
|