summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorjmallett <jmallett@FreeBSD.org>2002-04-20 18:46:33 +0000
committerjmallett <jmallett@FreeBSD.org>2002-04-20 18:46:33 +0000
commitc5bca421d9f59f412886b51e99d578df72fa1269 (patch)
tree9ad4bf0413b6523a315ac540668bf74c277271bf /tools
parente9f37843940b64df7aec2c86132e0b1cd043dec4 (diff)
downloadFreeBSD-src-c5bca421d9f59f412886b51e99d578df72fa1269.zip
FreeBSD-src-c5bca421d9f59f412886b51e99d578df72fa1269.tar.gz
Add regression tests for parts of xargs(1).
Diffstat (limited to 'tools')
-rw-r--r--tools/regression/usr.bin/Makefile2
-rw-r--r--tools/regression/usr.bin/xargs/Makefile4
-rw-r--r--tools/regression/usr.bin/xargs/regress.I.out4
-rw-r--r--tools/regression/usr.bin/xargs/regress.J.out1
-rw-r--r--tools/regression/usr.bin/xargs/regress.L.out2
-rw-r--r--tools/regression/usr.bin/xargs/regress.in4
-rw-r--r--tools/regression/usr.bin/xargs/regress.normal.out1
-rw-r--r--tools/regression/usr.bin/xargs/regress.sh32
8 files changed, 49 insertions, 1 deletions
diff --git a/tools/regression/usr.bin/Makefile b/tools/regression/usr.bin/Makefile
index cf08fba..a96a5fb7 100644
--- a/tools/regression/usr.bin/Makefile
+++ b/tools/regression/usr.bin/Makefile
@@ -1,5 +1,5 @@
# $FreeBSD$
-SUBDIR= uudecode uuencode
+SUBDIR= uudecode uuencode xargs
.include <bsd.subdir.mk>
diff --git a/tools/regression/usr.bin/xargs/Makefile b/tools/regression/usr.bin/xargs/Makefile
new file mode 100644
index 0000000..9903670
--- /dev/null
+++ b/tools/regression/usr.bin/xargs/Makefile
@@ -0,0 +1,4 @@
+# $FreeBSD$
+
+all:
+ @sh ${.CURDIR}/regress.sh ${.CURDIR}
diff --git a/tools/regression/usr.bin/xargs/regress.I.out b/tools/regression/usr.bin/xargs/regress.I.out
new file mode 100644
index 0000000..921a4f1
--- /dev/null
+++ b/tools/regression/usr.bin/xargs/regress.I.out
@@ -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
diff --git a/tools/regression/usr.bin/xargs/regress.J.out b/tools/regression/usr.bin/xargs/regress.J.out
new file mode 100644
index 0000000..b88a41e
--- /dev/null
+++ b/tools/regression/usr.bin/xargs/regress.J.out
@@ -0,0 +1 @@
+The quick brown fox jumped over the lazy dog again.
diff --git a/tools/regression/usr.bin/xargs/regress.L.out b/tools/regression/usr.bin/xargs/regress.L.out
new file mode 100644
index 0000000..7359dee
--- /dev/null
+++ b/tools/regression/usr.bin/xargs/regress.L.out
@@ -0,0 +1,2 @@
+quick brown fox jumped over the lazy
+dog
diff --git a/tools/regression/usr.bin/xargs/regress.in b/tools/regression/usr.bin/xargs/regress.in
new file mode 100644
index 0000000..5252b48
--- /dev/null
+++ b/tools/regression/usr.bin/xargs/regress.in
@@ -0,0 +1,4 @@
+quick brown
+fox jumped
+over the lazy
+dog
diff --git a/tools/regression/usr.bin/xargs/regress.normal.out b/tools/regression/usr.bin/xargs/regress.normal.out
new file mode 100644
index 0000000..458d9cb
--- /dev/null
+++ b/tools/regression/usr.bin/xargs/regress.normal.out
@@ -0,0 +1 @@
+The quick brown fox jumped over the lazy dog
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
OpenPOWER on IntegriCloud