diff options
Diffstat (limited to 'tools/regression/usr.bin/xargs/regress.sh')
-rw-r--r-- | tools/regression/usr.bin/xargs/regress.sh | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tools/regression/usr.bin/xargs/regress.sh b/tools/regression/usr.bin/xargs/regress.sh new file mode 100644 index 0000000..fa8b7ee --- /dev/null +++ b/tools/regression/usr.bin/xargs/regress.sh @@ -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 |