From 0317135e4df983e0190c48d883284ed936eaa9ed Mon Sep 17 00:00:00 2001 From: jmallett Date: Mon, 24 Jun 2002 13:51:30 +0000 Subject: Add a simple (to be expanded) library of functions for the regression tests, to handle the ones which output to stdout and have output in regress.$test.out, etc. More freeform macros should and will be written, but these are the most prominent and most straightforward sort of tests we have around, so it makes sense to try to accomodate them. --- tools/regression/usr.bin/regress.m4 | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tools/regression/usr.bin/regress.m4 (limited to 'tools') diff --git a/tools/regression/usr.bin/regress.m4 b/tools/regression/usr.bin/regress.m4 new file mode 100644 index 0000000..ff25c2c --- /dev/null +++ b/tools/regression/usr.bin/regress.m4 @@ -0,0 +1,23 @@ +# $FreeBSD$ + +define(`REGRESSION_START', +TESTDIR=$1 +if [ -z "$TESTDIR" ]; then + TESTDIR=. +fi +cd $TESTDIR + +STATUS=0) + +define(`REGRESSION_TEST', +echo "Running test $1" +$2 | diff -u regress.$1.out - +if [ $? -eq 0 ]; then + echo "PASS: Test $1 detected no regression." +else + STATUS=$? + echo "FAIL: Test $1 failed: regression detected. See above." +fi) + +define(`REGRESSION_END', +exit $STATUS) -- cgit v1.1