Debian Codegraph @

test/suites/api/check-exports

raw
1 #!/bin/sh
2 #
3 # This test checks that libjansson.so exports the correct symbols.
4 #
5
6 SOFILE="../src/.libs/libjansson.so"
7
8 # The list of symbols, which the shared object should export, is read
9 # from the def file, which is used in Windows builds
10 grep 'json_\|jansson_' $top_srcdir/src/jansson.def \
11 | sed -e 's/ //g' \
12 | sort \
13 >$test_log/exports
14
15 nm -D $SOFILE >/dev/null >$test_log/symbols 2>/dev/null \
16 || exit 77 # Skip if "nm -D" doesn't seem to work
17
18 grep ' [DT] ' $test_log/symbols | cut -d' ' -f3 | grep -v '^_' | sed 's/@@libjansson.*//' | sort >$test_log/output
19
20 if ! cmp -s $test_log/exports $test_log/output; then
21 diff -u $test_log/exports $test_log/output >&2
22 exit 1
23 fi