summaryrefslogtreecommitdiffstats
path: root/tools
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
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')
-rw-r--r--tools/regression/usr.bin/sed/Makefile2
-rw-r--r--tools/regression/usr.bin/sed/regress.sh34
-rw-r--r--tools/regression/usr.bin/uuencode/Makefile2
-rw-r--r--tools/regression/usr.bin/uuencode/regress.sh30
-rw-r--r--tools/regression/usr.bin/xargs/Makefile2
-rw-r--r--tools/regression/usr.bin/xargs/regress.sh42
6 files changed, 19 insertions, 93 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()
diff --git a/tools/regression/usr.bin/uuencode/Makefile b/tools/regression/usr.bin/uuencode/Makefile
index 9903670..b937d41 100644
--- a/tools/regression/usr.bin/uuencode/Makefile
+++ b/tools/regression/usr.bin/uuencode/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/uuencode/regress.sh b/tools/regression/usr.bin/uuencode/regress.sh
index b039768..ec78286 100644
--- a/tools/regression/usr.bin/uuencode/regress.sh
+++ b/tools/regression/usr.bin/uuencode/regress.sh
@@ -1,33 +1,11 @@
# $FreeBSD$
-# Go into the regression test directory, handed to us by make(1)
-TESTDIR=$1
-if [ -z "$TESTDIR" ]; then
- TESTDIR=.
-fi
-cd $TESTDIR
-
-STATUS=0
+REGRESSION_START($1)
# To make sure we end up with matching headers.
umask 022
-for test in traditional base64; do
- echo "Running test $test"
- case "$test" in
- traditional)
- uuencode regress.in < regress.in | diff -u regress.$test.out -
- ;;
- base64)
- uuencode -m regress.in < 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
+REGRESSION_TEST(`traditional', `uuencode regress.in < regress.in')
+REGRESSION_TEST(`base64', `uuencode -m regress.in < regress.in')
-exit $STATUS
+REGRESSION_END()
diff --git a/tools/regression/usr.bin/xargs/Makefile b/tools/regression/usr.bin/xargs/Makefile
index 9903670..b937d41 100644
--- a/tools/regression/usr.bin/xargs/Makefile
+++ b/tools/regression/usr.bin/xargs/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/xargs/regress.sh b/tools/regression/usr.bin/xargs/regress.sh
index 5c83b5c..dbf0ecc 100644
--- a/tools/regression/usr.bin/xargs/regress.sh
+++ b/tools/regression/usr.bin/xargs/regress.sh
@@ -1,39 +1,11 @@
# $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(`normal', `xargs echo The < regress.in')
+REGRESSION_TEST(`I', `xargs -I% echo The % % % %% % % < regress.in')
+REGRESSION_TEST(`J', `xargs -J% echo The % again. < regress.in')
+REGRESSION_TEST(`L', `xargs -L3 echo < regress.in')
+REGRESSION_TEST(`R', `xargs -I% -R1 echo The % % % %% % % < regress.in')
-for test in normal I J L R; do
- echo "Running test $test"
- case "$test" in
- normal)
- xargs echo The < regress.in | diff -u regress.$test.out -
- ;;
- I)
- xargs -I% echo The % % % %% % % < regress.in | diff -u regress.$test.out -
- ;;
- J)
- xargs -J% echo The % again. < regress.in | diff -u regress.$test.out -
- ;;
- L)
- xargs -L3 echo < regress.in | diff -u regress.$test.out -
- ;;
- R)
- xargs -I% -R1 echo The % % % %% % % < 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