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/build | |
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/build')
-rw-r--r-- | tools/build/make_check/Makefile | 45 | ||||
-rw-r--r-- | tools/build/make_check/regress.t | 5 |
2 files changed, 21 insertions, 29 deletions
diff --git a/tools/build/make_check/Makefile b/tools/build/make_check/Makefile index d9c1847..7715d23 100644 --- a/tools/build/make_check/Makefile +++ b/tools/build/make_check/Makefile @@ -19,49 +19,36 @@ DATA1:= ${DATA5:S/l/r/g} NIL= all: - @echo "Running test variables" + @echo '1..14' @echo 1:${DATA1} 2:${DATA2} 3:${DATA3} 4:${DATA4} 5:${DATA5} | \ diff -u ${.CURDIR}/regress.variables.out - || ${MAKE} failure - @echo "PASS: Test variables detected no regression, output matches." - @echo "Running test targets" + @echo "ok 1 - test_variables # Test variables detected no regression, output matches." @${MAKE} double 2>/dev/null || ${MAKE} failure - @echo "PASS: Test targets detected no regression." - @echo "Running test sysvmatch" + @echo "ok 2 - test_targets # Test targets detected no regression." @${MAKE} sysvmatch || ${MAKE} failure - @echo "PASS: Test sysvmatch detected no regression." - @echo "Running test lhs_expn" + @echo "ok 3 - sysvmatch # Test sysvmatch detected no regression." @! ${MAKE} lhs_expn && true || ${MAKE} failure - @echo "PASS: Test lhs_expn detected no regression." - @echo "Running test notdef" + @echo "ok 4 lhs_expn # Test lhs_expn detected no regression." @${MAKE} notdef || ${MAKE} failure - @echo "PASS: Test notdef detected no regression." - @echo "Running test modifiers" + @echo "ok 5 - notdef # Test notdef detected no regression." @${MAKE} modifiers || ${MAKE} failure - @echo "PASS: Test modifiers detected no regression." - @echo "Running test funny_targets" + @echo "ok 6 - modifiers # Test modifiers detected no regression." @${MAKE} funny_targets || ${MAKE} failure - @echo "PASS: Test funny_targets detected no regression." - @echo "Running test arith_expr" + @echo "ok 7 funny_targets # Test funny_targets detected no regression." @${MAKE} arith_expr || ${MAKE} failure - @echo "PASS: Test arith_expr detected no regression." - @echo "Running test PATH_exists" + @echo "ok 8 arith_expr # Test arith_expr detected no regression." @${MAKE} PATH_exists || ${MAKE} failure - @echo "PASS: Test PATH_exists detected no regression." - @echo "Running test double_quotes" + @echo "ok 9 PATH_exists # Test PATH_exists detected no regression." @${MAKE} double_quotes || ${MAKE} failure - @echo "PASS: Test double_quotes detected no regression." - @echo "Running test double_quotes2" + @echo "ok 10 double_quotes # Test double_quotes detected no regression." @! ${MAKE} double_quotes2 >/dev/null 2>&1 && true || ${MAKE} failure - @echo "PASS: Test double_quotes2 detected no regression." - @echo "Running test pass_cmd_vars" + @echo "ok 11 double_quotes2 # Test double_quotes2 detected no regression." @${MAKE} pass_cmd_vars || ${MAKE} failure - @echo "PASS: Test pass_cmd_vars detected no regression." - @echo "Running test plus_flag" + @echo "ok 12 pass_cmd_vars # Test pass_cmd_vars detected no regression." @${MAKE} plus_flag || ${MAKE} failure - @echo "PASS: Test plus_flag detected no regression." - @echo "Running test shell" + @echo "ok 13 plus_flag # Test plus_flag detected no regression." @! ${MAKE} shell >/dev/null 2>&1 && true || ${MAKE} failure - @echo "PASS: Test shell detected no regression." + @echo "ok 14 shell # Test shell detected no regression." .if make(double) # Doubly-defined targets. make(1) will warn, but use the "right" one. If it @@ -247,5 +234,5 @@ shell: .endif failure: - @echo "FAIL: Test failed: regression detected. See above." + @echo "not ok # Test failed: regression detected. See above." @false diff --git a/tools/build/make_check/regress.t b/tools/build/make_check/regress.t new file mode 100644 index 0000000..e37f332 --- /dev/null +++ b/tools/build/make_check/regress.t @@ -0,0 +1,5 @@ +#!/bin/sh +# $FreeBSD$ + +cd `dirname $0` +make all |