2011-06-22 13:58:01 +02:00
|
|
|
#!/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
|
2016-06-02 18:26:14 +02:00
|
|
|
# the discussion in https://gcc.gnu.org/wiki/Visibility'
|
2011-06-22 13:58:01 +02:00
|
|
|
|
|
|
|
test_description='exception symbol hiding'
|
|
|
|
|
2017-09-25 22:38:19 +02:00
|
|
|
. $(dirname "$0")/test-lib.sh || exit 1
|
2011-06-22 13:58:01 +02:00
|
|
|
|
2015-06-08 08:02:22 +02:00
|
|
|
test_begin_subtest 'running test' run_test
|
|
|
|
mkdir -p ${PWD}/fakedb/.notmuch
|
2016-05-25 23:37:40 +02:00
|
|
|
$TEST_DIRECTORY/symbol-test ${PWD}/fakedb ${PWD}/nonexistent 2>&1 \
|
2020-07-30 02:01:29 +02:00
|
|
|
| notmuch_dir_sanitize | sed -e "s,\`,\',g" -e "s,No [^[:space:]]* database,No XXXXXX database,g" > OUTPUT
|
2015-06-08 08:02:22 +02:00
|
|
|
|
|
|
|
cat <<EOF > EXPECTED
|
|
|
|
A Xapian exception occurred opening database: Couldn't stat 'CWD/fakedb/.notmuch/xapian'
|
2020-07-30 02:01:29 +02:00
|
|
|
caught No XXXXXX database found at path 'CWD/nonexistent'
|
2015-06-08 08:02:22 +02:00
|
|
|
EOF
|
|
|
|
test_expect_equal_file EXPECTED OUTPUT
|
2011-11-29 07:51:15 +01:00
|
|
|
|
2011-06-22 13:58:01 +02:00
|
|
|
test_begin_subtest 'checking output'
|
2012-01-11 17:53:59 +01:00
|
|
|
test_expect_equal "$result" "$output"
|
2011-11-29 07:51:16 +01:00
|
|
|
|
|
|
|
test_begin_subtest 'comparing existing to exported symbols'
|
2020-12-15 21:45:09 +01:00
|
|
|
readelf -Ws $NOTMUCH_BUILDDIR/lib/libnotmuch.so | sed -e 's/\[[^]]*\]//' |\
|
2020-12-11 18:06:44 +01:00
|
|
|
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
|
2011-11-29 07:51:16 +01:00
|
|
|
test_expect_equal_file EXPORTED ACTUAL
|
|
|
|
|
2011-06-22 13:58:01 +02:00
|
|
|
test_done
|