Debian Codegraph @

debian/tests/testsuite

raw
1 #!/bin/sh
2
3 set -e
4
5 WORKDIR=$(mktemp -d)
6 trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM
7
8 # build the tests, but do not run them
9 export DEB_BUILD_OPTIONS="nocheck $DEB_BUILD_OPTIONS"
10 dpkg-buildpackage --no-sign --rules-target build
11 cd build-deb1
12 make test-programs
13
14 # copy the built tests (not the libtool wrappers)
15 cp -a test/.libs/* $WORKDIR
16
17 cd $WORKDIR
18 errs=
19
20 for t in *; do
21 echo "========== Running test $t =========="
22 if [ -x ./$t ]; then
23 rc=
24 ./$t || rc=$?
25 if [ -z "$rc" ]; then
26 echo "========== OK $t =========="
27 elif [ $rc -eq 77 ]; then
28 echo "========== IGNORE $t =========="
29 else
30 echo "========== FAIL $t =========="
31 errs="$errs $t"
32 fi
33 fi
34 done
35
36 if [ -n "$errs" ]; then
37 echo "Testsuite failed ($errs)"
38 exit 1
39 else
40 echo "Testsuite passed"
41 exit 0
42 fi
43