Add regression tests for parts of xargs(1).
This commit is contained in:
parent
2cf0f79dcb
commit
f8b175feba
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=95142
@ -1,5 +1,5 @@
|
||||
# $FreeBSD$
|
||||
|
||||
SUBDIR= uudecode uuencode
|
||||
SUBDIR= uudecode uuencode xargs
|
||||
|
||||
.include <bsd.subdir.mk>
|
||||
|
4
tools/regression/usr.bin/xargs/Makefile
Normal file
4
tools/regression/usr.bin/xargs/Makefile
Normal file
@ -0,0 +1,4 @@
|
||||
# $FreeBSD$
|
||||
|
||||
all:
|
||||
@sh ${.CURDIR}/regress.sh ${.CURDIR}
|
4
tools/regression/usr.bin/xargs/regress.I.out
Normal file
4
tools/regression/usr.bin/xargs/regress.I.out
Normal 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
|
1
tools/regression/usr.bin/xargs/regress.J.out
Normal file
1
tools/regression/usr.bin/xargs/regress.J.out
Normal file
@ -0,0 +1 @@
|
||||
The quick brown fox jumped over the lazy dog again.
|
2
tools/regression/usr.bin/xargs/regress.L.out
Normal file
2
tools/regression/usr.bin/xargs/regress.L.out
Normal file
@ -0,0 +1,2 @@
|
||||
quick brown fox jumped over the lazy
|
||||
dog
|
4
tools/regression/usr.bin/xargs/regress.in
Normal file
4
tools/regression/usr.bin/xargs/regress.in
Normal file
@ -0,0 +1,4 @@
|
||||
quick brown
|
||||
fox jumped
|
||||
over the lazy
|
||||
dog
|
1
tools/regression/usr.bin/xargs/regress.normal.out
Normal file
1
tools/regression/usr.bin/xargs/regress.normal.out
Normal file
@ -0,0 +1 @@
|
||||
The quick brown fox jumped over the lazy dog
|
32
tools/regression/usr.bin/xargs/regress.sh
Normal file
32
tools/regression/usr.bin/xargs/regress.sh
Normal 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
|
Loading…
Reference in New Issue
Block a user