summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorjmallett <jmallett@FreeBSD.org>2002-06-24 14:19:57 +0000
committerjmallett <jmallett@FreeBSD.org>2002-06-24 14:19:57 +0000
commit93460fd6eff0b0cedfcc83460ad7f63ecab0630d (patch)
treec13ac929e52ef2c39859b313c66dfd15603e1226 /tools
parentf1504e8564a3a71c6ef1a359a72af707759b14ae (diff)
downloadFreeBSD-src-93460fd6eff0b0cedfcc83460ad7f63ecab0630d.zip
FreeBSD-src-93460fd6eff0b0cedfcc83460ad7f63ecab0630d.tar.gz
Add two new mostly freeform types of regression tests, and a macro for dying
ungracefully.
Diffstat (limited to 'tools')
-rw-r--r--tools/regression/usr.bin/regress.m430
1 files changed, 30 insertions, 0 deletions
diff --git a/tools/regression/usr.bin/regress.m4 b/tools/regression/usr.bin/regress.m4
index be5cc61..79f0968 100644
--- a/tools/regression/usr.bin/regress.m4
+++ b/tools/regression/usr.bin/regress.m4
@@ -28,6 +28,36 @@ else
echo "FAIL: Test $1 failed: regression detected. See above."
fi)
+dnl A freeform regression test. Only exit status is checked.
+define(`REGRESSION_TEST_FREEFORM',
+$2
+if [ $? -eq 0 ]; then
+ echo "PASS: Test $1 detected no regression."
+else
+ STATUS=$?
+ echo "FAIL: Test $1 failed: regression detected. See above."
+fi)
+
+dnl A regression test like REGRESSION_TEST, except only regress.out is used
+dnl for checking output differences. The first argument is the command, the
+dnl second argument (which may be empty) is the test name.
+define(`REGRESSION_TEST_ONE',
+echo "Running test $2"
+$1 | diff -u regress.out -
+if [ $? -eq 0 ]; then
+ echo "PASS: Test $2 detected no regression."
+else
+ STATUS=$?
+ echo "FAIL: Test $2 failed: regression detected. See above."
+fi)
+
+dnl A fatal error. This will exit with the given status (first argument) and
+dnl print the message (second argument) prefixed with the string "FATAL :" to
+dnl the error stream.
+define(`REGRESSION_FATAL',
+echo "FATAL: $2" > /dev/stderr
+exit $1)
+
dnl Cleanup. Exit with the status code of the last failure. Should probably
dnl be the number of failed tests, but hey presto, this is what it does. This
dnl could also clean up potential droppings, if some forms of regression tests
OpenPOWER on IntegriCloud