X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=branch%2Fmultisys%2Finst%2Fetc%2Fhook%2FB92test-pkg;fp=branch%2Fmultisys%2Finst%2Fetc%2Fhook%2FB92test-pkg;h=7372ca0301a38f1f903917bcbed1d36bb8065494;hb=413d9e15b7bd5f8f36685c2cccbb9bbed3a3a0b9;hp=0000000000000000000000000000000000000000;hpb=65fce8cd87d7d6f0209611ff7a264819e42a6c9e;p=cran2deb.git diff --git a/branch/multisys/inst/etc/hook/B92test-pkg b/branch/multisys/inst/etc/hook/B92test-pkg new file mode 100755 index 0000000..7372ca0 --- /dev/null +++ b/branch/multisys/inst/etc/hook/B92test-pkg @@ -0,0 +1,52 @@ +#!/bin/bash +# example file to be used with --hookdir +# +# run tests. Current directory is top of source-code. +# +# 2005, 2007 Junichi Uekawa +# +set -e + +echo "Installing the prerequisites" +for PKG in $(ls /tmp/buildd/*.deb | sed -e's,.*/,,;s,_.*,,' ); do + apt-get install -y --force-yes "$PKG" || true + apt-get remove -y "$PKG" || true +done +# ignore the failures since they are not the prime interest + +dpkg -i /tmp/buildd/*.deb + +if chmod a+x /tmp/buildd/*/debian/pbuilder-test/*; then + : +else + echo "W: no pbuilder-test script found, skipping" + exit 0 +fi + +SUCCESS=0 +COUNT=0 +unset FAIL || true +NOFAIL=1 + +# The current directory is the top of the source-tree. +cd /tmp/buildd/*/debian/.. + +for SCRIPT in $(run-parts --test /tmp/buildd/*/debian/pbuilder-test) ; do + echo "--- BEGIN test: ${SCRIPT##*/}" + if "${SCRIPT}"; then + echo SUCCESS + ((SUCCESS=SUCCESS+1)) + else + echo FAIL + FAIL[${#FAIL[@]}]="${SCRIPT##*/}" + NOFAIL=0 + fi + echo "--- END test: ${SCRIPT##*/}" + ((COUNT=COUNT+1)) +done + +echo "Summary:" +echo "=== $SUCCESS out of $COUNT tests passed" +echo "${FAIL[@]/#/ failed }" +echo "-- end of testsuite." +