Add regression tests for parts of xargs(1).

This commit is contained in:
Juli Mallett 2002-04-20 18:46:33 +00:00
parent 2cf0f79dcb
commit f8b175feba
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=95142
8 changed files with 49 additions and 1 deletions

View File

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

View File

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

View File

@ -0,0 +1,4 @@
The quick brown quick brown quick brown quick brownquick brown quick brown %
The fox jumped fox jumped fox jumped fox jumpedfox jumped fox jumped %
The over the lazy over the lazy over the lazy over the lazyover the lazy over the lazy %
The dog dog dog dogdog dog % dog the

View File

@ -0,0 +1 @@
The quick brown fox jumped over the lazy dog again.

View File

@ -0,0 +1,2 @@
quick brown fox jumped over the lazy
dog

View File

@ -0,0 +1,4 @@
quick brown
fox jumped
over the lazy
dog

View File

@ -0,0 +1 @@
The quick brown fox jumped over the lazy dog

View File

@ -0,0 +1,32 @@
# $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 normal I J L; 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 -
;;
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