regress.m4 (137587) | regress.m4 (263227) |
---|---|
1# $FreeBSD: head/tools/regression/usr.bin/regress.m4 137587 2004-11-11 19:47:55Z nik $ | 1# $FreeBSD: head/usr.bin/tests/regress.m4 263227 2014-03-16 08:04:06Z jmmv $ |
2 3dnl A library of routines for doing regression tests for userland utilities. 4 5dnl Start up. We initialise the exit status to 0 (no failure) and change 6dnl into the directory specified by our first argument, which is the 7dnl directory to run the tests inside. 8define(`REGRESSION_START', 9TESTDIR=$1 --- 14 unchanged lines hidden (view full) --- 24 echo "not ok - $1 # Test failed: regression detected. See above. (in $TESTDIR)" 25fi) 26 27dnl An actual test. The first parameter is the test name. The second is the 28dnl command/commands to execute for the actual test. Their exit status is 29dnl checked. It is assumed that the test will output to stdout, and that the 30dnl output to be used to check for regression will be in regress.TESTNAME.out. 31define(`REGRESSION_TEST', | 2 3dnl A library of routines for doing regression tests for userland utilities. 4 5dnl Start up. We initialise the exit status to 0 (no failure) and change 6dnl into the directory specified by our first argument, which is the 7dnl directory to run the tests inside. 8define(`REGRESSION_START', 9TESTDIR=$1 --- 14 unchanged lines hidden (view full) --- 24 echo "not ok - $1 # Test failed: regression detected. See above. (in $TESTDIR)" 25fi) 26 27dnl An actual test. The first parameter is the test name. The second is the 28dnl command/commands to execute for the actual test. Their exit status is 29dnl checked. It is assumed that the test will output to stdout, and that the 30dnl output to be used to check for regression will be in regress.TESTNAME.out. 31define(`REGRESSION_TEST', |
32$2 | diff -u regress.$1.out - | 32$2 | diff -u ${SRCDIR:-.}/regress.$1.out - |
33REGRESSION_PASSFAIL($1)) 34 35dnl A freeform regression test. Only exit status is checked. 36define(`REGRESSION_TEST_FREEFORM', 37$2 38REGRESSION_PASSFAIL($1)) 39 40dnl A regression test like REGRESSION_TEST, except only regress.out is used 41dnl for checking output differences. The first argument is the command, the 42dnl second argument (which may be empty) is the test name. 43define(`REGRESSION_TEST_ONE', | 33REGRESSION_PASSFAIL($1)) 34 35dnl A freeform regression test. Only exit status is checked. 36define(`REGRESSION_TEST_FREEFORM', 37$2 38REGRESSION_PASSFAIL($1)) 39 40dnl A regression test like REGRESSION_TEST, except only regress.out is used 41dnl for checking output differences. The first argument is the command, the 42dnl second argument (which may be empty) is the test name. 43define(`REGRESSION_TEST_ONE', |
44$1 | diff -u regress.out - | 44$1 | diff -u ${SRCDIR:-.}/regress.out - |
45REGRESSION_PASSFAIL($2)) 46 47dnl A fatal error. This will exit with the given status (first argument) and 48dnl print the message (second argument) prefixed with the string "FATAL :" to 49dnl the error stream. 50define(`REGRESSION_FATAL', 51echo "Bail out! $2 (in $TESTDIR)" > /dev/stderr 52exit $1) 53 54dnl Cleanup. Exit with the status code of the last failure. Should probably 55dnl be the number of failed tests, but hey presto, this is what it does. This 56dnl could also clean up potential droppings, if some forms of regression tests 57dnl end up using mktemp(1) or such. 58define(`REGRESSION_END', 59exit $STATUS) | 45REGRESSION_PASSFAIL($2)) 46 47dnl A fatal error. This will exit with the given status (first argument) and 48dnl print the message (second argument) prefixed with the string "FATAL :" to 49dnl the error stream. 50define(`REGRESSION_FATAL', 51echo "Bail out! $2 (in $TESTDIR)" > /dev/stderr 52exit $1) 53 54dnl Cleanup. Exit with the status code of the last failure. Should probably 55dnl be the number of failed tests, but hey presto, this is what it does. This 56dnl could also clean up potential droppings, if some forms of regression tests 57dnl end up using mktemp(1) or such. 58define(`REGRESSION_END', 59exit $STATUS) |