Start adding framework for userland regression tests, and tests for

uuencode and uudecode.
This commit is contained in:
Juli Mallett 2002-04-20 17:20:21 +00:00
parent 946b2d0057
commit 88ef037391
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=95138
6 changed files with 65 additions and 1 deletions

View file

@ -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

View file

@ -0,0 +1,5 @@
# $FreeBSD$
SUBDIR= uudecode uuencode
.include <bsd.subdir.mk>

View file

@ -0,0 +1,4 @@
# $FreeBSD$
all:
@sh ${.CURDIR}/regress.sh ${.CURDIR}

View file

@ -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

View file

@ -0,0 +1,4 @@
# $FreeBSD$
all:
@sh ${.CURDIR}/regress.sh ${.CURDIR}

View file

@ -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