1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
#!/bin/sh
#
# This is a simple script that tests libwn-dev
#
# install as: /usr/lib/debian-test/tests/libwn-dev
# or else as: /usr/lib/debian-test/tests/libwn-dev/test-1
# In the latter case, /usr/lib/debian-test/tests/libwn-dev/ can contain
# other file with test data and/or other scripts named test-2, test-3, etc.
#
# You can run this script with the command
# sh debian/tests
# After installation, you can run it with the commands
# /usr/lib/debian-test/tests/libwn-dev
# or
# debian-test -v libwn-dev
# see debian-test(1)
. ${DEBIANTEST_LIB:-/usr/lib/debian-test/lib}/functions.sh
TESTDIR=/usr/lib/debian-test/tests/libwn-dev
## we need a scratch directory in which to execute
TMP=/tmp/libwn-dev-test.$$
test -e $TMP && rm -rf $TMP
mkdir $TMP
cd $TMP
trap "rm -rf $TMP" EXIT
thetest(){
gcc -o selftest $TESTDIR/$d-selftest.c -lwn -lm && ./selftest
return $?
}
for d in btr cmp hash low mem; do \
runtest "test library section $d" thetest; \
done
|