summaryrefslogtreecommitdiffstats
path: root/tools/regression/usr.bin/sed
diff options
context:
space:
mode:
authorjmallett <jmallett@FreeBSD.org>2002-06-24 13:52:28 +0000
committerjmallett <jmallett@FreeBSD.org>2002-06-24 13:52:28 +0000
commit0309fb3139201cfe15f9590262dfe4ee00851823 (patch)
treea0894c70a89fe5ff44526f204b51c34f504b5eec /tools/regression/usr.bin/sed
parent19361eefdfe5fdd95aa861cd7e85012fef653176 (diff)
downloadFreeBSD-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/Makefile2
-rw-r--r--tools/regression/usr.bin/sed/regress.sh34
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()
OpenPOWER on IntegriCloud