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.
This commit is contained in:
parent
0f0f563b6e
commit
0317135e4d
23
tools/regression/usr.bin/regress.m4
Normal file
23
tools/regression/usr.bin/regress.m4
Normal file
@ -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)
|
Loading…
x
Reference in New Issue
Block a user