Juli Mallett 533e28dbe1 Only exit at the end of a test, exit with the last value of $? that was not 0.
This way the entire regression test is looked at as a pass/fail, not just one
sub-test.
2002-04-21 00:18:29 +00:00

36 lines
879 B
Bash

# $FreeBSD$
# Go into the regression test directory, handed to us by make(1)
TESTDIR=$1
if [ -z "$TESTDIR" ]; then
TESTDIR=.
fi
cd $TESTDIR
STATUS=0
# Note that currently the uuencode(1) program provides no facility to
# include the file mode explicitly based on an argument passed to it,
# so the regress.in file must be mode 644, or the test will say that,
# incorrectly, regression has occurred based on the header.
for test in traditional base64; do
echo "Running test $test"
case "$test" in
traditional)
uuencode regress.in regress.in | diff -u regress.$test.out -
;;
base64)
uuencode -m regress.in regress.in | diff -u regress.$test.out -
;;
esac
if [ $? -eq 0 ]; then
echo "Test $test detected no regression, output matches."
else
STATUS=$?
echo "Test $test failed: regression detected. See above."
fi
done
exit $STATUS