Add check for internal symbols

This commit is contained in:
Behdad Esfahbod 2010-05-12 23:28:38 -04:00
parent eee8598d75
commit 3b649a38b5
2 changed files with 30 additions and 1 deletions

View File

@ -99,7 +99,8 @@ main_SOURCES = main.cc
main_CPPFLAGS = $(HBCFLAGS) main_CPPFLAGS = $(HBCFLAGS)
main_LDADD = libharfbuzz.la $(HBLIBS) main_LDADD = libharfbuzz.la $(HBLIBS)
TESTS = TESTS = \
check-internal-symbols.sh
if HAVE_ICU if HAVE_ICU
else else

28
src/check-internal-symbols.sh Executable file
View File

@ -0,0 +1,28 @@
#!/bin/sh
LC_ALL=C
export LC_ALL
if which nm 2>/dev/null >/dev/null; then
:
else
echo "check-internal-symbols.sh: 'nm' not found; skipping test"
exit 0
fi
test -z "$srcdir" && srcdir=.
test -z "$MAKE" && MAKE=make
stat=0
so=.libs/libharfbuzz.so
if test -f "$so"; then
echo "Checking that we are exposing internal symbols"
if nm $so | grep ' T _hb'; then
echo "Ouch, internal symbols exposed"
stat=1
fi
else
echo "check-internal-symbols.sh: libharfbuzz.so not found; skipping test"
fi
exit $stat