summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorjmallett <jmallett@FreeBSD.org>2002-06-24 14:22:44 +0000
committerjmallett <jmallett@FreeBSD.org>2002-06-24 14:22:44 +0000
commit9d6012e9cff6568695d5687f1363e64284be1704 (patch)
treeb5307ddbfe04c261e575860283cd6be7e4605b37 /tools
parent93460fd6eff0b0cedfcc83460ad7f63ecab0630d (diff)
downloadFreeBSD-src-9d6012e9cff6568695d5687f1363e64284be1704.zip
FreeBSD-src-9d6012e9cff6568695d5687f1363e64284be1704.tar.gz
Move all remaining tests except for:
make(1): Does not work like the other tests. Its Makefile is self-testing. m4(1): It uses complex voodo to test GNU m4(1) features. To the new framework. I had worried about passing the binary data that uudecode(1)'s test passes to diff(1) might give a user something nasty, but this is unlikely to happen as even with an unmodified old nasty diff(1) which doesn't recognise many binary files, these binary files are recognised. Using $DIFF instead of `diff' in the library and making it possible to override this with `cmp -s' might be nice some day, but as of this second, there's no immediate need.
Diffstat (limited to 'tools')
-rw-r--r--tools/regression/usr.bin/file2c/Makefile2
-rw-r--r--tools/regression/usr.bin/file2c/regress.sh17
-rw-r--r--tools/regression/usr.bin/join/Makefile2
-rw-r--r--tools/regression/usr.bin/join/regress.sh18
-rw-r--r--tools/regression/usr.bin/jot/Makefile2
-rw-r--r--tools/regression/usr.bin/jot/regress.sh17
-rw-r--r--tools/regression/usr.bin/m4/Makefile2
-rw-r--r--tools/regression/usr.bin/m4/regress.sh11
-rw-r--r--tools/regression/usr.bin/uudecode/Makefile2
-rw-r--r--tools/regression/usr.bin/uudecode/regress.sh23
10 files changed, 23 insertions, 73 deletions
diff --git a/tools/regression/usr.bin/file2c/Makefile b/tools/regression/usr.bin/file2c/Makefile
index 9903670..b937d41 100644
--- a/tools/regression/usr.bin/file2c/Makefile
+++ b/tools/regression/usr.bin/file2c/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/file2c/regress.sh b/tools/regression/usr.bin/file2c/regress.sh
index b716788..7558529 100644
--- a/tools/regression/usr.bin/file2c/regress.sh
+++ b/tools/regression/usr.bin/file2c/regress.sh
@@ -1,16 +1,7 @@
# $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)
-file2c 'const char data[] = {' ', 0};' < regress.in | diff -u regress.out -
-if [ $? -eq 0 ]; then
- echo "PASS: Test detected no regression, output matches."
-else
- echo "FAIL: Test failed: regression detected. See above."
- exit 1
-fi
+REGRESSION_TEST_ONE(`file2c "const char data[] = {" ", 0};" < regress.in')
+
+REGRESSION_END()
diff --git a/tools/regression/usr.bin/join/Makefile b/tools/regression/usr.bin/join/Makefile
index 9903670..b937d41 100644
--- a/tools/regression/usr.bin/join/Makefile
+++ b/tools/regression/usr.bin/join/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/join/regress.sh b/tools/regression/usr.bin/join/regress.sh
index 2c2e9a7..ee041f2 100644
--- a/tools/regression/usr.bin/join/regress.sh
+++ b/tools/regression/usr.bin/join/regress.sh
@@ -1,17 +1,7 @@
# $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)
-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 "PASS: Test detected no regression, output matches."
-else
- echo "FAIL: Test failed: regression detected. See above."
- exit 1
-fi
+REGRESSION_TEST_ONE(`join -t , -a1 -a2 -e "(unknown)" -o 0,1.2,2.2 regress.1.in regress.2.in')
+
+REGRESSION_END()
diff --git a/tools/regression/usr.bin/jot/Makefile b/tools/regression/usr.bin/jot/Makefile
index 9903670..b937d41 100644
--- a/tools/regression/usr.bin/jot/Makefile
+++ b/tools/regression/usr.bin/jot/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/jot/regress.sh b/tools/regression/usr.bin/jot/regress.sh
index 91b39a8..5b7d43a 100644
--- a/tools/regression/usr.bin/jot/regress.sh
+++ b/tools/regression/usr.bin/jot/regress.sh
@@ -1,16 +1,7 @@
# $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)
-jot -w '%X' -s ',' 100 1 200 | diff -u regress.out -
-if [ $? -eq 0 ]; then
- echo "PASS: Test detected no regression, output matches."
-else
- echo "FAIL: Test failed: regression detected. See above."
- exit 1
-fi
+REGRESSION_TEST_ONE(`jot -w "%X" -s , 100 1 200')
+
+REGRESSION_END()
diff --git a/tools/regression/usr.bin/m4/Makefile b/tools/regression/usr.bin/m4/Makefile
index 9903670..b937d41 100644
--- a/tools/regression/usr.bin/m4/Makefile
+++ b/tools/regression/usr.bin/m4/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/m4/regress.sh b/tools/regression/usr.bin/m4/regress.sh
index fdc7de0..84f4fb5 100644
--- a/tools/regression/usr.bin/m4/regress.sh
+++ b/tools/regression/usr.bin/m4/regress.sh
@@ -1,13 +1,6 @@
# $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)
for test in GNU/changecom changecom; do
echo "Running test $test"
@@ -35,4 +28,4 @@ for test in GNU/changecom changecom; do
fi
done
-exit $STATUS
+REGRESSION_END()
diff --git a/tools/regression/usr.bin/uudecode/Makefile b/tools/regression/usr.bin/uudecode/Makefile
index 9903670..b937d41 100644
--- a/tools/regression/usr.bin/uudecode/Makefile
+++ b/tools/regression/usr.bin/uudecode/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/uudecode/regress.sh b/tools/regression/usr.bin/uudecode/regress.sh
index a12066d..f4f745a 100644
--- a/tools/regression/usr.bin/uudecode/regress.sh
+++ b/tools/regression/usr.bin/uudecode/regress.sh
@@ -1,23 +1,8 @@
# $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_ONE(`uudecode -p < regress.traditional.in', `traditional')
+REGRESSION_TEST_ONE(`uudecode -p < regress.base64.in', `base64')
-for test in traditional base64; do
- echo "Running test $test"
- uudecode -p < regress.$test.in | cmp regress.out -
- 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