diff options
author | jmallett <jmallett@FreeBSD.org> | 2002-06-24 13:52:28 +0000 |
---|---|---|
committer | jmallett <jmallett@FreeBSD.org> | 2002-06-24 13:52:28 +0000 |
commit | 0309fb3139201cfe15f9590262dfe4ee00851823 (patch) | |
tree | a0894c70a89fe5ff44526f204b51c34f504b5eec /tools/regression/usr.bin/sed | |
parent | 19361eefdfe5fdd95aa861cd7e85012fef653176 (diff) | |
download | FreeBSD-src-0309fb3139201cfe15f9590262dfe4ee00851823.zip FreeBSD-src-0309fb3139201cfe15f9590262dfe4ee00851823.tar.gz |
Convert straightforward regression tests to use regress.m4.
Goodbye, duplicated code, you will certainly not be missed.
Diffstat (limited to 'tools/regression/usr.bin/sed')
-rw-r--r-- | tools/regression/usr.bin/sed/Makefile | 2 | ||||
-rw-r--r-- | tools/regression/usr.bin/sed/regress.sh | 34 |
2 files changed, 6 insertions, 30 deletions
diff --git a/tools/regression/usr.bin/sed/Makefile b/tools/regression/usr.bin/sed/Makefile index 9903670..b937d41 100644 --- a/tools/regression/usr.bin/sed/Makefile +++ b/tools/regression/usr.bin/sed/Makefile @@ -1,4 +1,4 @@ # $FreeBSD$ all: - @sh ${.CURDIR}/regress.sh ${.CURDIR} + @m4 ${.CURDIR}/../regress.m4 ${.CURDIR}/regress.sh | sh /dev/stdin ${.CURDIR} diff --git a/tools/regression/usr.bin/sed/regress.sh b/tools/regression/usr.bin/sed/regress.sh index d7a773c..bec79f1 100644 --- a/tools/regression/usr.bin/sed/regress.sh +++ b/tools/regression/usr.bin/sed/regress.sh @@ -1,33 +1,9 @@ # $FreeBSD$ -# Go into the regression test directory, handed to us by make(1) -TESTDIR=$1 -if [ -z "$TESTDIR" ]; then - TESTDIR=. -fi -cd $TESTDIR +REGRESSION_START($1) -STATUS=0 +REGRESSION_TEST(`G', `sed G < regress.in') +REGRESSION_TEST(`P', `sed P < regress.in') +REGRESSION_TEST(`psl', `sed \$!g\;P\;D < regress.in') -for test in G P psl; do - echo "Running test $test" - case "$test" in - G) - sed G < regress.in | diff -u regress.$test.out - - ;; - P) - sed P < regress.in | diff -u regress.$test.out - - ;; - psl) - sed '$!g; P; D' < regress.in | diff -u regress.$test.out - - ;; - esac - if [ $? -eq 0 ]; then - echo "PASS: Test $test detected no regression, output matches." - else - STATUS=$? - echo "FAIL: Test $test failed: regression detected. See above." - fi -done - -exit $STATUS +REGRESSION_END() |