From 624abf8519406ed85bc1ef618ef72cf06f3916d5 Mon Sep 17 00:00:00 2001 From: Juli Mallett Date: Sat, 27 Apr 2002 02:26:23 +0000 Subject: [PATCH] Prefix tests with PASS and FAIL, to make grepping easier, and note this in the README. This affects only the base-system regression tests, of course. --- tools/build/make_check/Makefile | 6 +++--- tools/regression/README | 5 +++++ tools/regression/usr.bin/file2c/regress.sh | 4 ++-- tools/regression/usr.bin/join/regress.sh | 4 ++-- tools/regression/usr.bin/jot/regress.sh | 4 ++-- tools/regression/usr.bin/make/Makefile | 6 +++--- tools/regression/usr.bin/sed/regress.sh | 4 ++-- tools/regression/usr.bin/uudecode/regress.sh | 4 ++-- tools/regression/usr.bin/uuencode/regress.sh | 4 ++-- tools/regression/usr.bin/xargs/regress.sh | 4 ++-- 10 files changed, 25 insertions(+), 20 deletions(-) diff --git a/tools/build/make_check/Makefile b/tools/build/make_check/Makefile index 9b65f905167..2176dae233f 100644 --- a/tools/build/make_check/Makefile +++ b/tools/build/make_check/Makefile @@ -13,10 +13,10 @@ all: @echo "Running test variables" @echo 1:${DATA1} 2:${DATA2} 3:${DATA3} 4:${DATA4} 5:${DATA5} | \ diff -u ${.CURDIR}/regress.variables.out - || ${MAKE} failure - @echo "Test variables detected no regression, output matches." + @echo "PASS: Test variables detected no regression, output matches." @echo "Running test targets" @${MAKE} double || ${MAKE} failure - @echo "Test targets detected no regression." + @echo "PASS: Test targets detected no regression." # Doubly-defined targets. NetBSD make(1) will warn, ours will silently use the # ``right'' one. @@ -27,5 +27,5 @@ double: @false failure: - @echo "Test failed: regression detected. See above." + @echo "FAIL: Test failed: regression detected. See above." @false diff --git a/tools/regression/README b/tools/regression/README index bb2a2796803..895b620a8b4 100644 --- a/tools/regression/README +++ b/tools/regression/README @@ -10,6 +10,11 @@ which is the same as their path relative to src/, for example the uuencode(1) utility resides in src/usr.bin/uuencode so its regression test resides in src/tools/regression/usr.bin/uuencode. +Base system regression tests should prefix their test results with 'PASS' or +'FAIL' accordingly, to make checking for failed tests easier. For now the +tests are very free-form, and it's up to you to do that. Eventually, it +should be a part of the regression test framework. + Please make a subdir per other regression test, and add a brief description to this file. diff --git a/tools/regression/usr.bin/file2c/regress.sh b/tools/regression/usr.bin/file2c/regress.sh index 7f4c2717de7..b7167882a58 100644 --- a/tools/regression/usr.bin/file2c/regress.sh +++ b/tools/regression/usr.bin/file2c/regress.sh @@ -9,8 +9,8 @@ cd $TESTDIR file2c 'const char data[] = {' ', 0};' < regress.in | diff -u regress.out - if [ $? -eq 0 ]; then - echo "Test detected no regression, output matches." + echo "PASS: Test detected no regression, output matches." else - echo "Test failed: regression detected. See above." + echo "FAIL: Test failed: regression detected. See above." exit 1 fi diff --git a/tools/regression/usr.bin/join/regress.sh b/tools/regression/usr.bin/join/regress.sh index 5e9eea40481..2c2e9a7bed6 100644 --- a/tools/regression/usr.bin/join/regress.sh +++ b/tools/regression/usr.bin/join/regress.sh @@ -10,8 +10,8 @@ cd $TESTDIR join -t , -a1 -a2 -e '(unknown)' -o 0,1.2,2.2 regress.1.in regress.2.in | \ diff -u regress.out - if [ $? -eq 0 ]; then - echo "Test detected no regression, output matches." + echo "PASS: Test detected no regression, output matches." else - echo "Test failed: regression detected. See above." + echo "FAIL: Test failed: regression detected. See above." exit 1 fi diff --git a/tools/regression/usr.bin/jot/regress.sh b/tools/regression/usr.bin/jot/regress.sh index f013e82c281..91b39a86946 100644 --- a/tools/regression/usr.bin/jot/regress.sh +++ b/tools/regression/usr.bin/jot/regress.sh @@ -9,8 +9,8 @@ cd $TESTDIR jot -w '%X' -s ',' 100 1 200 | diff -u regress.out - if [ $? -eq 0 ]; then - echo "Test detected no regression, output matches." + echo "PASS: Test detected no regression, output matches." else - echo "Test failed: regression detected. See above." + echo "FAIL: Test failed: regression detected. See above." exit 1 fi diff --git a/tools/regression/usr.bin/make/Makefile b/tools/regression/usr.bin/make/Makefile index 9b65f905167..2176dae233f 100644 --- a/tools/regression/usr.bin/make/Makefile +++ b/tools/regression/usr.bin/make/Makefile @@ -13,10 +13,10 @@ all: @echo "Running test variables" @echo 1:${DATA1} 2:${DATA2} 3:${DATA3} 4:${DATA4} 5:${DATA5} | \ diff -u ${.CURDIR}/regress.variables.out - || ${MAKE} failure - @echo "Test variables detected no regression, output matches." + @echo "PASS: Test variables detected no regression, output matches." @echo "Running test targets" @${MAKE} double || ${MAKE} failure - @echo "Test targets detected no regression." + @echo "PASS: Test targets detected no regression." # Doubly-defined targets. NetBSD make(1) will warn, ours will silently use the # ``right'' one. @@ -27,5 +27,5 @@ double: @false failure: - @echo "Test failed: regression detected. See above." + @echo "FAIL: Test failed: regression detected. See above." @false diff --git a/tools/regression/usr.bin/sed/regress.sh b/tools/regression/usr.bin/sed/regress.sh index 9198b3ffcf7..d7a773cf035 100644 --- a/tools/regression/usr.bin/sed/regress.sh +++ b/tools/regression/usr.bin/sed/regress.sh @@ -23,10 +23,10 @@ for test in G P psl; do ;; esac if [ $? -eq 0 ]; then - echo "Test $test detected no regression, output matches." + echo "PASS: Test $test detected no regression, output matches." else STATUS=$? - echo "Test $test failed: regression detected. See above." + echo "FAIL: Test $test failed: regression detected. See above." fi done diff --git a/tools/regression/usr.bin/uudecode/regress.sh b/tools/regression/usr.bin/uudecode/regress.sh index eb8874f1d2d..a12066d70cb 100644 --- a/tools/regression/usr.bin/uudecode/regress.sh +++ b/tools/regression/usr.bin/uudecode/regress.sh @@ -13,10 +13,10 @@ for test in traditional base64; do echo "Running test $test" uudecode -p < regress.$test.in | cmp regress.out - if [ $? -eq 0 ]; then - echo "Test $test detected no regression, output matches." + echo "PASS: Test $test detected no regression, output matches." else STATUS=$? - echo "Test $test failed: regression detected. See above." + echo "FAIL: Test $test failed: regression detected. See above." fi done diff --git a/tools/regression/usr.bin/uuencode/regress.sh b/tools/regression/usr.bin/uuencode/regress.sh index cce41386ed2..97a5986c637 100644 --- a/tools/regression/usr.bin/uuencode/regress.sh +++ b/tools/regression/usr.bin/uuencode/regress.sh @@ -25,10 +25,10 @@ for test in traditional base64; do ;; esac if [ $? -eq 0 ]; then - echo "Test $test detected no regression, output matches." + echo "PASS: Test $test detected no regression, output matches." else STATUS=$? - echo "Test $test failed: regression detected. See above." + echo "FAIL: Test $test failed: regression detected. See above." fi done diff --git a/tools/regression/usr.bin/xargs/regress.sh b/tools/regression/usr.bin/xargs/regress.sh index cfc6992a68b..836b10ef361 100644 --- a/tools/regression/usr.bin/xargs/regress.sh +++ b/tools/regression/usr.bin/xargs/regress.sh @@ -26,10 +26,10 @@ for test in normal I J L; do ;; esac if [ $? -eq 0 ]; then - echo "Test $test detected no regression, output matches." + echo "PASS: Test $test detected no regression, output matches." else STATUS=$? - echo "Test $test failed: regression detected. See above." + echo "FAIL: Test $test failed: regression detected. See above." fi done