diff options
author | dds <dds@FreeBSD.org> | 2007-03-14 13:38:23 +0000 |
---|---|---|
committer | dds <dds@FreeBSD.org> | 2007-03-14 13:38:23 +0000 |
commit | 645a28e4a71f792c782b52c8a27dad6dba4c3654 (patch) | |
tree | 92f9c6a8143d16ce3bc6787832cfed86cbb868e0 | |
parent | 243428b8ef749ab342177aa2bd2d0d401438e311 (diff) | |
download | FreeBSD-src-645a28e4a71f792c782b52c8a27dad6dba4c3654.zip FreeBSD-src-645a28e4a71f792c782b52c8a27dad6dba4c3654.tar.gz |
Reinstate error-testing regression tests.
33 files changed, 107 insertions, 78 deletions
diff --git a/tools/regression/usr.bin/sed/multitest.t b/tools/regression/usr.bin/sed/multitest.t index fc38251..594afaf 100644 --- a/tools/regression/usr.bin/sed/multitest.t +++ b/tools/regression/usr.bin/sed/multitest.t @@ -48,12 +48,10 @@ main() REGRESS=regress.multitest.out DICT=/usr/share/dict/words - #test_error | more - awk 'END { for (i = 1; i < 15; i++) print "l1_" i}' </dev/null >lines1 awk 'END { for (i = 1; i < 10; i++) print "l2_" i}' </dev/null >lines2 - echo "1..90" + echo "1..121" exec 4>&1 5>&2 tests @@ -76,6 +74,7 @@ tests() test_pattern test_print test_subst + test_error # Handle the result of the last test result } @@ -88,6 +87,10 @@ result() else TODO='' fi + if ! [ -r $REGRESS/${MARK}_${TESTNAME} ] ; then + echo "Seeding $REGRESS/${MARK}_${TESTNAME} with current result" 1>&2 + cp current.out $REGRESS/${MARK}_${TESTNAME} + fi if diff -c $REGRESS/${MARK}_${TESTNAME} current.out ; then echo "ok $MARK $TESTNAME # $TODO$COMMENT" else @@ -432,42 +435,38 @@ u2/g' lines1 test_error() { - exec 0>&3 4>&1 5>&2 - exec 0</dev/null - exec 2>&1 - set -x - $TEST -x && exit 1 - $TEST -f && exit 1 - $TEST -e && exit 1 - $TEST -f /dev/dds && exit 1 - $TEST p /dev/dds && exit 1 - $TEST -f /bin/sh && exit 1 - $TEST '{' && exit 1 - $TEST '{' && exit 1 - $TEST '/hello/' && exit 1 - $TEST '1,/hello/' && exit 1 - $TEST -e '-5p' && exit 1 - $TEST '/jj' && exit 1 - $TEST 'a hello' && exit 1 - $TEST 'a \ hello' && exit 1 - $TEST 'b foo' && exit 1 - $TEST 'd hello' && exit 1 - $TEST 's/aa' && exit 1 - $TEST 's/aa/' && exit 1 - $TEST 's/a/b' && exit 1 - $TEST 's/a/b/c/d' && exit 1 - $TEST 's/a/b/ 1 2' && exit 1 - $TEST 's/a/b/ 1 g' && exit 1 - $TEST 's/a/b/w' && exit 1 - $TEST 'y/aa' && exit 1 - $TEST 'y/aa/b/' && exit 1 - $TEST 'y/aa/' && exit 1 - $TEST 'y/a/b' && exit 1 - $TEST 'y/a/b/c/d' && exit 1 - $TEST '!' && exit 1 - $TEST supercalifrangolisticexprialidociussupercalifrangolisticexcius - set +x - exec 0>&3 1>&4 2>&5 + COMMENT='Error cases' + mark '9.1' ; $SED -x 2>/dev/null ; echo $? + mark '9.2' ; $SED -f 2>/dev/null ; echo $? + mark '9.3' ; $SED -e 2>/dev/null ; echo $? + mark '9.4' ; $SED -f /dev/xyzzyxyzy 2>/dev/null ; echo $? + mark '9.5' ; $SED p /dev/xyzzyxyzy 2>/dev/null ; echo $? + mark '9.6' ; $SED -f /bin/sh 2>/dev/null ; echo $? + mark '9.7' ; $SED '{' 2>/dev/null ; echo $? + mark '9.8' ; $SED '{' 2>/dev/null ; echo $? + mark '9.9' ; $SED '/hello/' 2>/dev/null ; echo $? + mark '9.10' ; $SED '1,/hello/' 2>/dev/null ; echo $? + mark '9.11' ; $SED -e '-5p' 2>/dev/null ; echo $? + mark '9.12' ; $SED '/jj' 2>/dev/null ; echo $? + mark '9.13' ; $SED 'a hello' 2>/dev/null ; echo $? + mark '9.14' ; $SED 'a \ hello' 2>/dev/null ; echo $? + mark '9.15' ; $SED 'b foo' 2>/dev/null ; echo $? + mark '9.16' ; $SED 'd hello' 2>/dev/null ; echo $? + mark '9.17' ; $SED 's/aa' 2>/dev/null ; echo $? + mark '9.18' ; $SED 's/aa/' 2>/dev/null ; echo $? + mark '9.19' ; $SED 's/a/b' 2>/dev/null ; echo $? + mark '9.20' ; $SED 's/a/b/c/d' 2>/dev/null ; echo $? + mark '9.21' ; $SED 's/a/b/ 1 2' 2>/dev/null ; echo $? + mark '9.22' ; $SED 's/a/b/ 1 g' 2>/dev/null ; echo $? + mark '9.23' ; $SED 's/a/b/w' 2>/dev/null ; echo $? + mark '9.24' ; $SED 'y/aa' 2>/dev/null ; echo $? + mark '9.25' ; $SED 'y/aa/b/' 2>/dev/null ; echo $? + mark '9.26' ; $SED 'y/aa/' 2>/dev/null ; echo $? + mark '9.27' ; $SED 'y/a/b' 2>/dev/null ; echo $? + mark '9.28' ; $SED 'y/a/b/c/d' 2>/dev/null ; echo $? + mark '9.29' ; $SED '!' 2>/dev/null ; echo $? + mark '9.30' ; $SED supercalifrangolisticexprialidociussupercalifrangolisticexcius 2>/dev/null ; echo $? + mark '9.31' ; $SED '' /dev/null 2>/dev/null ; echo $? } main diff --git a/tools/regression/usr.bin/sed/regress.multitest.out/100_9.10 b/tools/regression/usr.bin/sed/regress.multitest.out/100_9.10 new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/tools/regression/usr.bin/sed/regress.multitest.out/100_9.10 @@ -0,0 +1 @@ +1 diff --git a/tools/regression/usr.bin/sed/regress.multitest.out/101_9.11 b/tools/regression/usr.bin/sed/regress.multitest.out/101_9.11 new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/tools/regression/usr.bin/sed/regress.multitest.out/101_9.11 @@ -0,0 +1 @@ +1 diff --git a/tools/regression/usr.bin/sed/regress.multitest.out/102_9.12 b/tools/regression/usr.bin/sed/regress.multitest.out/102_9.12 new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/tools/regression/usr.bin/sed/regress.multitest.out/102_9.12 @@ -0,0 +1 @@ +1 diff --git a/tools/regression/usr.bin/sed/regress.multitest.out/103_9.13 b/tools/regression/usr.bin/sed/regress.multitest.out/103_9.13 new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/tools/regression/usr.bin/sed/regress.multitest.out/103_9.13 @@ -0,0 +1 @@ +1 diff --git a/tools/regression/usr.bin/sed/regress.multitest.out/104_9.14 b/tools/regression/usr.bin/sed/regress.multitest.out/104_9.14 new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/tools/regression/usr.bin/sed/regress.multitest.out/104_9.14 @@ -0,0 +1 @@ +1 diff --git a/tools/regression/usr.bin/sed/regress.multitest.out/105_9.15 b/tools/regression/usr.bin/sed/regress.multitest.out/105_9.15 new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/tools/regression/usr.bin/sed/regress.multitest.out/105_9.15 @@ -0,0 +1 @@ +1 diff --git a/tools/regression/usr.bin/sed/regress.multitest.out/106_9.16 b/tools/regression/usr.bin/sed/regress.multitest.out/106_9.16 new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/tools/regression/usr.bin/sed/regress.multitest.out/106_9.16 @@ -0,0 +1 @@ +1 diff --git a/tools/regression/usr.bin/sed/regress.multitest.out/107_9.17 b/tools/regression/usr.bin/sed/regress.multitest.out/107_9.17 new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/tools/regression/usr.bin/sed/regress.multitest.out/107_9.17 @@ -0,0 +1 @@ +1 diff --git a/tools/regression/usr.bin/sed/regress.multitest.out/108_9.18 b/tools/regression/usr.bin/sed/regress.multitest.out/108_9.18 new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/tools/regression/usr.bin/sed/regress.multitest.out/108_9.18 @@ -0,0 +1 @@ +1 diff --git a/tools/regression/usr.bin/sed/regress.multitest.out/109_9.19 b/tools/regression/usr.bin/sed/regress.multitest.out/109_9.19 new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/tools/regression/usr.bin/sed/regress.multitest.out/109_9.19 @@ -0,0 +1 @@ +1 diff --git a/tools/regression/usr.bin/sed/regress.multitest.out/110_9.20 b/tools/regression/usr.bin/sed/regress.multitest.out/110_9.20 new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/tools/regression/usr.bin/sed/regress.multitest.out/110_9.20 @@ -0,0 +1 @@ +1 diff --git a/tools/regression/usr.bin/sed/regress.multitest.out/111_9.21 b/tools/regression/usr.bin/sed/regress.multitest.out/111_9.21 new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/tools/regression/usr.bin/sed/regress.multitest.out/111_9.21 @@ -0,0 +1 @@ +1 diff --git a/tools/regression/usr.bin/sed/regress.multitest.out/112_9.22 b/tools/regression/usr.bin/sed/regress.multitest.out/112_9.22 new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/tools/regression/usr.bin/sed/regress.multitest.out/112_9.22 @@ -0,0 +1 @@ +1 diff --git a/tools/regression/usr.bin/sed/regress.multitest.out/113_9.23 b/tools/regression/usr.bin/sed/regress.multitest.out/113_9.23 new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/tools/regression/usr.bin/sed/regress.multitest.out/113_9.23 @@ -0,0 +1 @@ +1 diff --git a/tools/regression/usr.bin/sed/regress.multitest.out/114_9.24 b/tools/regression/usr.bin/sed/regress.multitest.out/114_9.24 new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/tools/regression/usr.bin/sed/regress.multitest.out/114_9.24 @@ -0,0 +1 @@ +1 diff --git a/tools/regression/usr.bin/sed/regress.multitest.out/115_9.25 b/tools/regression/usr.bin/sed/regress.multitest.out/115_9.25 new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/tools/regression/usr.bin/sed/regress.multitest.out/115_9.25 @@ -0,0 +1 @@ +1 diff --git a/tools/regression/usr.bin/sed/regress.multitest.out/116_9.26 b/tools/regression/usr.bin/sed/regress.multitest.out/116_9.26 new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/tools/regression/usr.bin/sed/regress.multitest.out/116_9.26 @@ -0,0 +1 @@ +1 diff --git a/tools/regression/usr.bin/sed/regress.multitest.out/117_9.27 b/tools/regression/usr.bin/sed/regress.multitest.out/117_9.27 new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/tools/regression/usr.bin/sed/regress.multitest.out/117_9.27 @@ -0,0 +1 @@ +1 diff --git a/tools/regression/usr.bin/sed/regress.multitest.out/118_9.28 b/tools/regression/usr.bin/sed/regress.multitest.out/118_9.28 new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/tools/regression/usr.bin/sed/regress.multitest.out/118_9.28 @@ -0,0 +1 @@ +1 diff --git a/tools/regression/usr.bin/sed/regress.multitest.out/119_9.29 b/tools/regression/usr.bin/sed/regress.multitest.out/119_9.29 new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/tools/regression/usr.bin/sed/regress.multitest.out/119_9.29 @@ -0,0 +1 @@ +1 diff --git a/tools/regression/usr.bin/sed/regress.multitest.out/120_9.30 b/tools/regression/usr.bin/sed/regress.multitest.out/120_9.30 new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/tools/regression/usr.bin/sed/regress.multitest.out/120_9.30 @@ -0,0 +1 @@ +1 diff --git a/tools/regression/usr.bin/sed/regress.multitest.out/121_9.31 b/tools/regression/usr.bin/sed/regress.multitest.out/121_9.31 new file mode 100644 index 0000000..573541a --- /dev/null +++ b/tools/regression/usr.bin/sed/regress.multitest.out/121_9.31 @@ -0,0 +1 @@ +0 diff --git a/tools/regression/usr.bin/sed/regress.multitest.out/91_9.1 b/tools/regression/usr.bin/sed/regress.multitest.out/91_9.1 new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/tools/regression/usr.bin/sed/regress.multitest.out/91_9.1 @@ -0,0 +1 @@ +1 diff --git a/tools/regression/usr.bin/sed/regress.multitest.out/92_9.2 b/tools/regression/usr.bin/sed/regress.multitest.out/92_9.2 new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/tools/regression/usr.bin/sed/regress.multitest.out/92_9.2 @@ -0,0 +1 @@ +1 diff --git a/tools/regression/usr.bin/sed/regress.multitest.out/93_9.3 b/tools/regression/usr.bin/sed/regress.multitest.out/93_9.3 new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/tools/regression/usr.bin/sed/regress.multitest.out/93_9.3 @@ -0,0 +1 @@ +1 diff --git a/tools/regression/usr.bin/sed/regress.multitest.out/94_9.4 b/tools/regression/usr.bin/sed/regress.multitest.out/94_9.4 new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/tools/regression/usr.bin/sed/regress.multitest.out/94_9.4 @@ -0,0 +1 @@ +1 diff --git a/tools/regression/usr.bin/sed/regress.multitest.out/95_9.5 b/tools/regression/usr.bin/sed/regress.multitest.out/95_9.5 new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/tools/regression/usr.bin/sed/regress.multitest.out/95_9.5 @@ -0,0 +1 @@ +1 diff --git a/tools/regression/usr.bin/sed/regress.multitest.out/96_9.6 b/tools/regression/usr.bin/sed/regress.multitest.out/96_9.6 new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/tools/regression/usr.bin/sed/regress.multitest.out/96_9.6 @@ -0,0 +1 @@ +1 diff --git a/tools/regression/usr.bin/sed/regress.multitest.out/97_9.7 b/tools/regression/usr.bin/sed/regress.multitest.out/97_9.7 new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/tools/regression/usr.bin/sed/regress.multitest.out/97_9.7 @@ -0,0 +1 @@ +1 diff --git a/tools/regression/usr.bin/sed/regress.multitest.out/98_9.8 b/tools/regression/usr.bin/sed/regress.multitest.out/98_9.8 new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/tools/regression/usr.bin/sed/regress.multitest.out/98_9.8 @@ -0,0 +1 @@ +1 diff --git a/tools/regression/usr.bin/sed/regress.multitest.out/99_9.9 b/tools/regression/usr.bin/sed/regress.multitest.out/99_9.9 new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/tools/regression/usr.bin/sed/regress.multitest.out/99_9.9 @@ -0,0 +1 @@ +1 diff --git a/tools/regression/usr.bin/sed/sed.test b/tools/regression/usr.bin/sed/sed.test index fc38251..594afaf 100644 --- a/tools/regression/usr.bin/sed/sed.test +++ b/tools/regression/usr.bin/sed/sed.test @@ -48,12 +48,10 @@ main() REGRESS=regress.multitest.out DICT=/usr/share/dict/words - #test_error | more - awk 'END { for (i = 1; i < 15; i++) print "l1_" i}' </dev/null >lines1 awk 'END { for (i = 1; i < 10; i++) print "l2_" i}' </dev/null >lines2 - echo "1..90" + echo "1..121" exec 4>&1 5>&2 tests @@ -76,6 +74,7 @@ tests() test_pattern test_print test_subst + test_error # Handle the result of the last test result } @@ -88,6 +87,10 @@ result() else TODO='' fi + if ! [ -r $REGRESS/${MARK}_${TESTNAME} ] ; then + echo "Seeding $REGRESS/${MARK}_${TESTNAME} with current result" 1>&2 + cp current.out $REGRESS/${MARK}_${TESTNAME} + fi if diff -c $REGRESS/${MARK}_${TESTNAME} current.out ; then echo "ok $MARK $TESTNAME # $TODO$COMMENT" else @@ -432,42 +435,38 @@ u2/g' lines1 test_error() { - exec 0>&3 4>&1 5>&2 - exec 0</dev/null - exec 2>&1 - set -x - $TEST -x && exit 1 - $TEST -f && exit 1 - $TEST -e && exit 1 - $TEST -f /dev/dds && exit 1 - $TEST p /dev/dds && exit 1 - $TEST -f /bin/sh && exit 1 - $TEST '{' && exit 1 - $TEST '{' && exit 1 - $TEST '/hello/' && exit 1 - $TEST '1,/hello/' && exit 1 - $TEST -e '-5p' && exit 1 - $TEST '/jj' && exit 1 - $TEST 'a hello' && exit 1 - $TEST 'a \ hello' && exit 1 - $TEST 'b foo' && exit 1 - $TEST 'd hello' && exit 1 - $TEST 's/aa' && exit 1 - $TEST 's/aa/' && exit 1 - $TEST 's/a/b' && exit 1 - $TEST 's/a/b/c/d' && exit 1 - $TEST 's/a/b/ 1 2' && exit 1 - $TEST 's/a/b/ 1 g' && exit 1 - $TEST 's/a/b/w' && exit 1 - $TEST 'y/aa' && exit 1 - $TEST 'y/aa/b/' && exit 1 - $TEST 'y/aa/' && exit 1 - $TEST 'y/a/b' && exit 1 - $TEST 'y/a/b/c/d' && exit 1 - $TEST '!' && exit 1 - $TEST supercalifrangolisticexprialidociussupercalifrangolisticexcius - set +x - exec 0>&3 1>&4 2>&5 + COMMENT='Error cases' + mark '9.1' ; $SED -x 2>/dev/null ; echo $? + mark '9.2' ; $SED -f 2>/dev/null ; echo $? + mark '9.3' ; $SED -e 2>/dev/null ; echo $? + mark '9.4' ; $SED -f /dev/xyzzyxyzy 2>/dev/null ; echo $? + mark '9.5' ; $SED p /dev/xyzzyxyzy 2>/dev/null ; echo $? + mark '9.6' ; $SED -f /bin/sh 2>/dev/null ; echo $? + mark '9.7' ; $SED '{' 2>/dev/null ; echo $? + mark '9.8' ; $SED '{' 2>/dev/null ; echo $? + mark '9.9' ; $SED '/hello/' 2>/dev/null ; echo $? + mark '9.10' ; $SED '1,/hello/' 2>/dev/null ; echo $? + mark '9.11' ; $SED -e '-5p' 2>/dev/null ; echo $? + mark '9.12' ; $SED '/jj' 2>/dev/null ; echo $? + mark '9.13' ; $SED 'a hello' 2>/dev/null ; echo $? + mark '9.14' ; $SED 'a \ hello' 2>/dev/null ; echo $? + mark '9.15' ; $SED 'b foo' 2>/dev/null ; echo $? + mark '9.16' ; $SED 'd hello' 2>/dev/null ; echo $? + mark '9.17' ; $SED 's/aa' 2>/dev/null ; echo $? + mark '9.18' ; $SED 's/aa/' 2>/dev/null ; echo $? + mark '9.19' ; $SED 's/a/b' 2>/dev/null ; echo $? + mark '9.20' ; $SED 's/a/b/c/d' 2>/dev/null ; echo $? + mark '9.21' ; $SED 's/a/b/ 1 2' 2>/dev/null ; echo $? + mark '9.22' ; $SED 's/a/b/ 1 g' 2>/dev/null ; echo $? + mark '9.23' ; $SED 's/a/b/w' 2>/dev/null ; echo $? + mark '9.24' ; $SED 'y/aa' 2>/dev/null ; echo $? + mark '9.25' ; $SED 'y/aa/b/' 2>/dev/null ; echo $? + mark '9.26' ; $SED 'y/aa/' 2>/dev/null ; echo $? + mark '9.27' ; $SED 'y/a/b' 2>/dev/null ; echo $? + mark '9.28' ; $SED 'y/a/b/c/d' 2>/dev/null ; echo $? + mark '9.29' ; $SED '!' 2>/dev/null ; echo $? + mark '9.30' ; $SED supercalifrangolisticexprialidociussupercalifrangolisticexcius 2>/dev/null ; echo $? + mark '9.31' ; $SED '' /dev/null 2>/dev/null ; echo $? } main |