Commit 1761774f authored by Niels Möller's avatar Niels Möller
Browse files

Improved testscript, copied from

nettle/testsuite.

Rev: src/testsuite/run-tests:1.1
parent 5513c6ff
#! /bin/bash
failed=0
all=0
if [ -z "$srcdir" ] ; then
srcdir=`pwd`
fi
export srcdir
find_program () {
if [ -x "$1" ] ; then
echo "./$1"
else
echo "$srcdir/$1"
fi
}
env_program () {
if [ -x "$1" ] ; then
if "$1"; then : ; else
echo FAIL: $1
exit 1
fi
fi
}
test_program () {
"$1"
case "$?" in
0)
echo PASS: ${1%-test}
all=`expr $all + 1`
;;
77)
echo SKIP: ${1%-test}
;;
*)
echo FAIL: ${1%-test}
failed=`expr $failed + 1`
all=`expr $all + 1`
;;
esac
}
env_program `find_program setup-env`
if [ $# -eq 0 ] ; then
for f in *-test; do test_program "./$f"; done
else
for f in "$@" ; do test_program `find_program "$f"`; done
fi
if [ $failed -eq 0 ] ; then
banner="All $all tests passed"
else
banner="$failed of $all tests failed"
fi
dashes=`echo "$banner" | sed s/./=/g`
echo "$dashes"
echo "$banner"
echo "$dashes"
env_program `find_program teardown-env`
[ "$failed" -eq 0 ]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment