diff options
author | nik <nik@FreeBSD.org> | 2004-11-11 19:47:55 +0000 |
---|---|---|
committer | nik <nik@FreeBSD.org> | 2004-11-11 19:47:55 +0000 |
commit | 3e959a33f972bdc48cced73e8f76eb9ce7ce64eb (patch) | |
tree | cfebca4a0526247931bc6bdde73f15f72f3e92d0 /tools/regression/usr.bin/regress.m4 | |
parent | 6e5bd296a6ca375161a672ed141aa5e414ffbc16 (diff) | |
download | FreeBSD-src-3e959a33f972bdc48cced73e8f76eb9ce7ce64eb.zip FreeBSD-src-3e959a33f972bdc48cced73e8f76eb9ce7ce64eb.tar.gz |
Switch over to a different, more flexible test output protocol that's
understood by Perl's Test::Harness module and prove(1) commands.
Update README to describe the new protocol. The work's broken down into
two main sets of changes.
First, update the existing test programs (shell scripts and C programs)
to produce output in the ok/not ok format, and to, where possible, also
produce a header describing the number of tests that are expected to be
run.
Second, provide the .t files that actually run the tests. In some cases
these are copies of, or very similar too, scripts that already existed.
I've kept the old scripts around so that it's possible to verify that
behaviour under this new system (in terms of whether or not a test fails)
is identical to the behaviour under the old system.
Add a TODO file.
Diffstat (limited to 'tools/regression/usr.bin/regress.m4')
-rw-r--r-- | tools/regression/usr.bin/regress.m4 | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/tools/regression/usr.bin/regress.m4 b/tools/regression/usr.bin/regress.m4 index 8a4551c..35e2ab9 100644 --- a/tools/regression/usr.bin/regress.m4 +++ b/tools/regression/usr.bin/regress.m4 @@ -18,10 +18,10 @@ dnl Check $? to see if we passed or failed. The first parameter is the test dnl which passed or failed. It may be nil. define(`REGRESSION_PASSFAIL', if [ $? -eq 0 ]; then - echo "PASS: Test $1 detected no regression. (in $TESTDIR)" + echo "ok - $1 # Test detected no regression. (in $TESTDIR)" else STATUS=$? - echo "FAIL: Test $1 failed: regression detected. See above. (in $TESTDIR)" + echo "not ok - $1 # Test failed: regression detected. See above. (in $TESTDIR)" fi) dnl An actual test. The first parameter is the test name. The second is the @@ -29,7 +29,6 @@ dnl command/commands to execute for the actual test. Their exit status is dnl checked. It is assumed that the test will output to stdout, and that the dnl output to be used to check for regression will be in regress.TESTNAME.out. define(`REGRESSION_TEST', -echo "Running test $1" $2 | diff -u regress.$1.out - REGRESSION_PASSFAIL($1)) @@ -42,7 +41,6 @@ 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 - REGRESSION_PASSFAIL($2)) @@ -50,7 +48,7 @@ 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 (in $TESTDIR)" > /dev/stderr +echo "Bail out! $2 (in $TESTDIR)" > /dev/stderr exit $1) dnl Cleanup. Exit with the status code of the last failure. Should probably |