summaryrefslogtreecommitdiffstats
path: root/tools/regression/usr.bin/regress.m4
diff options
context:
space:
mode:
authorjmallett <jmallett@FreeBSD.org>2002-06-24 13:51:30 +0000
committerjmallett <jmallett@FreeBSD.org>2002-06-24 13:51:30 +0000
commit0317135e4df983e0190c48d883284ed936eaa9ed (patch)
tree5373c95a789cf977e4e994e1e3beb36d99fb71bc /tools/regression/usr.bin/regress.m4
parent0f0f563b6e75a78c4b27456dd7d07bf4e7951c75 (diff)
downloadFreeBSD-src-0317135e4df983e0190c48d883284ed936eaa9ed.zip
FreeBSD-src-0317135e4df983e0190c48d883284ed936eaa9ed.tar.gz
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.
Diffstat (limited to 'tools/regression/usr.bin/regress.m4')
-rw-r--r--tools/regression/usr.bin/regress.m423
1 files changed, 23 insertions, 0 deletions
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)
OpenPOWER on IntegriCloud