2009-12-21 20:00:57 +08:00
|
|
|
#!/bin/sh
|
2012-04-30 03:09:29 +08:00
|
|
|
#
|
2012-01-25 03:03:36 +08:00
|
|
|
# This test checks that libjansson.so exports the correct symbols.
|
2012-04-30 03:09:29 +08:00
|
|
|
#
|
2009-12-21 20:00:57 +08:00
|
|
|
|
|
|
|
SOFILE="../src/.libs/libjansson.so"
|
|
|
|
|
2012-04-30 03:09:29 +08:00
|
|
|
# The list of symbols, which the shared object should export, is read
|
|
|
|
# from the def file, which is used in Windows builds
|
|
|
|
grep 'json_' $top_srcdir/src/jansson.def \
|
|
|
|
| sed -e 's/ //g' \
|
|
|
|
| sort \
|
|
|
|
>$test_log/exports
|
|
|
|
|
2011-03-27 18:34:43 +08:00
|
|
|
nm -D $SOFILE >/dev/null >$test_log/symbols 2>/dev/null \
|
|
|
|
|| exit 77 # Skip if "nm -D" doesn't seem to work
|
|
|
|
|
2012-08-11 21:13:47 +08:00
|
|
|
grep ' [DT] ' $test_log/symbols | cut -d' ' -f3 | sort >$test_log/output
|
2009-12-21 20:00:57 +08:00
|
|
|
|
|
|
|
if ! cmp -s $test_log/exports $test_log/output; then
|
|
|
|
diff -u $test_log/exports $test_log/output >&2
|
|
|
|
exit 1
|
|
|
|
fi
|