diff options
author | jmallett <jmallett@FreeBSD.org> | 2002-04-20 17:20:21 +0000 |
---|---|---|
committer | jmallett <jmallett@FreeBSD.org> | 2002-04-20 17:20:21 +0000 |
commit | b5175f501bb32dba3e63a58c2c1709974891000b (patch) | |
tree | 30a282aecfc94769c34f7970e07e17f308edb8c8 /tools | |
parent | 097dea9b47cdc2eb26836acddb5e56700ed2847d (diff) | |
download | FreeBSD-src-b5175f501bb32dba3e63a58c2c1709974891000b.zip FreeBSD-src-b5175f501bb32dba3e63a58c2c1709974891000b.tar.gz |
Start adding framework for userland regression tests, and tests for
uuencode and uudecode.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/regression/README | 8 | ||||
-rw-r--r-- | tools/regression/usr.bin/Makefile | 5 | ||||
-rw-r--r-- | tools/regression/usr.bin/uudecode/Makefile | 4 | ||||
-rw-r--r-- | tools/regression/usr.bin/uudecode/regress.sh | 19 | ||||
-rw-r--r-- | tools/regression/usr.bin/uuencode/Makefile | 4 | ||||
-rw-r--r-- | tools/regression/usr.bin/uuencode/regress.sh | 26 |
6 files changed, 65 insertions, 1 deletions
diff --git a/tools/regression/README b/tools/regression/README index 94ecb62..bb2a279 100644 --- a/tools/regression/README +++ b/tools/regression/README @@ -5,7 +5,13 @@ This directory is for regression test programs. A regression test program is one that will exercise a particular bit of the system to check that we have not reintroduced an old bug. -Please make a subdir per program, and add a brief description to this file. +Tests that are for parts of the base system should go into a directory here +which is the same as their path relative to src/, for example the uuencode(1) +utility resides in src/usr.bin/uuencode so its regression test resides in +src/tools/regression/usr.bin/uuencode. + +Please make a subdir per other regression test, and add a brief description to +this file. nfsmmap Some tests to exercise some tricky cases in NFS and mmap p1003_1b Exercise 1003.1B scheduler diff --git a/tools/regression/usr.bin/Makefile b/tools/regression/usr.bin/Makefile new file mode 100644 index 0000000..cf08fba --- /dev/null +++ b/tools/regression/usr.bin/Makefile @@ -0,0 +1,5 @@ +# $FreeBSD$ + +SUBDIR= uudecode uuencode + +.include <bsd.subdir.mk> diff --git a/tools/regression/usr.bin/uudecode/Makefile b/tools/regression/usr.bin/uudecode/Makefile new file mode 100644 index 0000000..9903670 --- /dev/null +++ b/tools/regression/usr.bin/uudecode/Makefile @@ -0,0 +1,4 @@ +# $FreeBSD$ + +all: + @sh ${.CURDIR}/regress.sh ${.CURDIR} diff --git a/tools/regression/usr.bin/uudecode/regress.sh b/tools/regression/usr.bin/uudecode/regress.sh new file mode 100644 index 0000000..36e224a --- /dev/null +++ b/tools/regression/usr.bin/uudecode/regress.sh @@ -0,0 +1,19 @@ +# $FreeBSD$ + +# Go into the regression test directory, handed to us by make(1) +TESTDIR=$1 +if [ -z "$TESTDIR" ]; then + TESTDIR=. +fi +cd $TESTDIR + +for test in traditional base64; do + echo "Running test $test" + uudecode -p < regress.$test.in | cmp regress.out - + if [ $? -eq 0 ]; then + echo "Test $test detected no regression, output matches." + else + echo "Test $test failed: regression detected. See above." + exit 1 + fi +done diff --git a/tools/regression/usr.bin/uuencode/Makefile b/tools/regression/usr.bin/uuencode/Makefile new file mode 100644 index 0000000..9903670 --- /dev/null +++ b/tools/regression/usr.bin/uuencode/Makefile @@ -0,0 +1,4 @@ +# $FreeBSD$ + +all: + @sh ${.CURDIR}/regress.sh ${.CURDIR} diff --git a/tools/regression/usr.bin/uuencode/regress.sh b/tools/regression/usr.bin/uuencode/regress.sh new file mode 100644 index 0000000..bf5b563 --- /dev/null +++ b/tools/regression/usr.bin/uuencode/regress.sh @@ -0,0 +1,26 @@ +# $FreeBSD$ + +# Go into the regression test directory, handed to us by make(1) +TESTDIR=$1 +if [ -z "$TESTDIR" ]; then + TESTDIR=. +fi +cd $TESTDIR + +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 "Test $test detected no regression, output matches." + else + echo "Test $test failed: regression detected. See above." + exit 1 + fi +done |