]> git.donarmstrong.com Git - cran2deb.git/blob - branch/multisys/inst/etc/hook/B92test-pkg
multisys: support for multiple os-arch configurations (preliminary)
[cran2deb.git] / branch / multisys / inst / etc / hook / B92test-pkg
1 #!/bin/bash
2 # example file to be used with --hookdir
3 #
4 # run tests. Current directory is top of source-code.
5 #
6 # 2005, 2007 Junichi Uekawa
7
8 set -e 
9
10 echo "Installing the prerequisites"
11 for PKG in $(ls /tmp/buildd/*.deb | sed -e's,.*/,,;s,_.*,,' ); do
12     apt-get install -y --force-yes "$PKG" || true 
13     apt-get remove -y "$PKG" || true 
14 done
15 # ignore the failures since they are not the prime interest
16
17 dpkg -i /tmp/buildd/*.deb
18
19 if chmod a+x /tmp/buildd/*/debian/pbuilder-test/*; then
20     :
21 else
22     echo "W: no pbuilder-test script found, skipping"
23     exit 0
24 fi
25
26 SUCCESS=0
27 COUNT=0
28 unset FAIL || true
29 NOFAIL=1
30
31 # The current directory is the top of the source-tree.
32 cd /tmp/buildd/*/debian/..
33
34 for SCRIPT in $(run-parts --test /tmp/buildd/*/debian/pbuilder-test) ; do
35     echo "--- BEGIN test: ${SCRIPT##*/}"
36     if "${SCRIPT}"; then
37         echo SUCCESS
38         ((SUCCESS=SUCCESS+1))
39     else
40         echo FAIL
41         FAIL[${#FAIL[@]}]="${SCRIPT##*/}"
42         NOFAIL=0
43     fi
44     echo "--- END test: ${SCRIPT##*/}"
45     ((COUNT=COUNT+1))
46 done
47
48 echo "Summary:"
49 echo "=== $SUCCESS out of $COUNT tests passed"
50 echo "${FAIL[@]/#/ failed }"
51 echo "-- end of testsuite."
52