Start adding framework for userland regression tests, and tests for
uuencode and uudecode.
This commit is contained in:
parent
946b2d0057
commit
88ef037391
@ -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
|
||||
|
5
tools/regression/usr.bin/Makefile
Normal file
5
tools/regression/usr.bin/Makefile
Normal file
@ -0,0 +1,5 @@
|
||||
# $FreeBSD$
|
||||
|
||||
SUBDIR= uudecode uuencode
|
||||
|
||||
.include <bsd.subdir.mk>
|
4
tools/regression/usr.bin/uudecode/Makefile
Normal file
4
tools/regression/usr.bin/uudecode/Makefile
Normal file
@ -0,0 +1,4 @@
|
||||
# $FreeBSD$
|
||||
|
||||
all:
|
||||
@sh ${.CURDIR}/regress.sh ${.CURDIR}
|
19
tools/regression/usr.bin/uudecode/regress.sh
Normal file
19
tools/regression/usr.bin/uudecode/regress.sh
Normal 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
|
4
tools/regression/usr.bin/uuencode/Makefile
Normal file
4
tools/regression/usr.bin/uuencode/Makefile
Normal file
@ -0,0 +1,4 @@
|
||||
# $FreeBSD$
|
||||
|
||||
all:
|
||||
@sh ${.CURDIR}/regress.sh ${.CURDIR}
|
26
tools/regression/usr.bin/uuencode/regress.sh
Normal file
26
tools/regression/usr.bin/uuencode/regress.sh
Normal 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
|
Loading…
Reference in New Issue
Block a user