3 # Copyright (c) 2011 David Bremner
6 # This test tests whether hiding Xapian::Error symbols in libnotmuch
7 # also hides them for other users of libxapian. This is motivated by
8 # the discussion in https://gcc.gnu.org/wiki/Visibility'
10 test_description='exception symbol hiding'
12 . ./test-lib.sh || exit 1
14 test_begin_subtest 'running test' run_test
15 mkdir -p ${PWD}/fakedb/.notmuch
16 ( LD_LIBRARY_PATH="$TEST_DIRECTORY/../lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" \
17 $TEST_DIRECTORY/symbol-test ${PWD}/fakedb ${PWD}/nonexistent \
18 2>&1 | notmuch_dir_sanitize | sed -e "s,\`,\',g" -e "s,${NOTMUCH_DEFAULT_XAPIAN_BACKEND},backend,g") > OUTPUT
21 A Xapian exception occurred opening database: Couldn't stat 'CWD/fakedb/.notmuch/xapian'
22 caught No backend database found at path 'CWD/nonexistent'
24 test_expect_equal_file EXPECTED OUTPUT
26 test_begin_subtest 'checking output'
27 test_expect_equal "$result" "$output"
29 test_begin_subtest 'comparing existing to exported symbols'
30 nm -P $TEST_DIRECTORY/../lib/libnotmuch.so | awk '$2 == "T" && $1 ~ "^notmuch" {print $1}' | sort | uniq > ACTUAL
31 sed -n 's/[[:blank:]]*\(notmuch_[^;]*\);/\1/p' $TEST_DIRECTORY/../notmuch.sym | sort | uniq > EXPORTED
32 test_expect_equal_file EXPORTED ACTUAL