summaryrefslogtreecommitdiffstats
path: root/usr.bin/xargs
diff options
context:
space:
mode:
authorjmmv <jmmv@FreeBSD.org>2014-04-27 01:15:10 +0000
committerjmmv <jmmv@FreeBSD.org>2014-04-27 01:15:10 +0000
commit1e4589b921fdaa1b1d2fc6b6ed016f1e0a01cb8f (patch)
tree94c86cf13dedabad5bdc68f6f227b843a5161343 /usr.bin/xargs
parent5b12da65bf9d40526ac9ca480d639bad3cd39cf6 (diff)
downloadFreeBSD-src-1e4589b921fdaa1b1d2fc6b6ed016f1e0a01cb8f.zip
FreeBSD-src-1e4589b921fdaa1b1d2fc6b6ed016f1e0a01cb8f.tar.gz
MFC various moves of tools/regressions/ tests to the new infrastructure.
- r263220 Migrate tools/regression/sbin/ to the new tests layout. - r263222 Add Makefile missed in r263220. - r263226 Migrate tools/regression/{usr.bin/lastcomm,usr.sbin}/ to the new tests layout. - r263227 Migrate most of tools/regression/usr.bin/ to the new tests layout. - r263345 Expand tabs that sneaked in into spaces. - r263346 Migrate tools/regression/usr.bin/make/ to the new tests layout. - r263348 Add Makefiles missed in r263346. - r263351 Migrate tools/regression/usr.bin/pkill/ to the new tests layout. - r263388 Mark multi_test as requiring /usr/share/dict/words. - r263814 Fix path to the run.pl script to let these tests run. - r264742 Prevent building tests when bootstrapping make. This is 'make tinderbox' clean.
Diffstat (limited to 'usr.bin/xargs')
-rw-r--r--usr.bin/xargs/Makefile6
-rw-r--r--usr.bin/xargs/tests/Makefile26
-rw-r--r--usr.bin/xargs/tests/legacy_test.sh6
-rw-r--r--usr.bin/xargs/tests/regress.0.inbin0 -> 86 bytes
-rw-r--r--usr.bin/xargs/tests/regress.0.out8
-rw-r--r--usr.bin/xargs/tests/regress.0I.out18
-rw-r--r--usr.bin/xargs/tests/regress.0J.out4
-rw-r--r--usr.bin/xargs/tests/regress.0L.out6
-rw-r--r--usr.bin/xargs/tests/regress.I.out4
-rw-r--r--usr.bin/xargs/tests/regress.J.out1
-rw-r--r--usr.bin/xargs/tests/regress.L.out2
-rw-r--r--usr.bin/xargs/tests/regress.R.out4
-rw-r--r--usr.bin/xargs/tests/regress.in4
-rw-r--r--usr.bin/xargs/tests/regress.n1.out8
-rw-r--r--usr.bin/xargs/tests/regress.n2.out4
-rw-r--r--usr.bin/xargs/tests/regress.n3.out3
-rw-r--r--usr.bin/xargs/tests/regress.normal.out1
-rw-r--r--usr.bin/xargs/tests/regress.quotes.in4
-rw-r--r--usr.bin/xargs/tests/regress.quotes.out7
-rw-r--r--usr.bin/xargs/tests/regress.sh21
20 files changed, 137 insertions, 0 deletions
diff --git a/usr.bin/xargs/Makefile b/usr.bin/xargs/Makefile
index 642e953..b627bf5 100644
--- a/usr.bin/xargs/Makefile
+++ b/usr.bin/xargs/Makefile
@@ -1,7 +1,13 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
# $FreeBSD$
+.include <bsd.own.mk>
+
PROG= xargs
SRCS= xargs.c strnsubst.c
+.if ${MK_TESTS} != "no"
+SUBDIR+= tests
+.endif
+
.include <bsd.prog.mk>
diff --git a/usr.bin/xargs/tests/Makefile b/usr.bin/xargs/tests/Makefile
new file mode 100644
index 0000000..2004d79
--- /dev/null
+++ b/usr.bin/xargs/tests/Makefile
@@ -0,0 +1,26 @@
+# $FreeBSD$
+
+TESTSDIR= ${TESTSBASE}/usr.bin/xargs
+
+TAP_TESTS_SH= legacy_test
+
+FILESDIR= ${TESTSDIR}
+FILES= regress.0.in
+FILES+= regress.0.out
+FILES+= regress.0I.out
+FILES+= regress.0J.out
+FILES+= regress.0L.out
+FILES+= regress.I.out
+FILES+= regress.J.out
+FILES+= regress.L.out
+FILES+= regress.R.out
+FILES+= regress.in
+FILES+= regress.n1.out
+FILES+= regress.n2.out
+FILES+= regress.n3.out
+FILES+= regress.normal.out
+FILES+= regress.quotes.in
+FILES+= regress.quotes.out
+FILES+= regress.sh
+
+.include <bsd.test.mk>
diff --git a/usr.bin/xargs/tests/legacy_test.sh b/usr.bin/xargs/tests/legacy_test.sh
new file mode 100644
index 0000000..1b6b806
--- /dev/null
+++ b/usr.bin/xargs/tests/legacy_test.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+# $FreeBSD$
+
+SRCDIR="$(dirname "${0}")"; export SRCDIR
+
+m4 "${SRCDIR}/../regress.m4" "${SRCDIR}/regress.sh" | sh
diff --git a/usr.bin/xargs/tests/regress.0.in b/usr.bin/xargs/tests/regress.0.in
new file mode 100644
index 0000000..448ba53
--- /dev/null
+++ b/usr.bin/xargs/tests/regress.0.in
Binary files differ
diff --git a/usr.bin/xargs/tests/regress.0.out b/usr.bin/xargs/tests/regress.0.out
new file mode 100644
index 0000000..2bc9725
--- /dev/null
+++ b/usr.bin/xargs/tests/regress.0.out
@@ -0,0 +1,8 @@
+quick ' brown
+fox jumped
+over "the lazy
+dog
+quick brown fox
+jumped over the
+lazy dog
+
diff --git a/usr.bin/xargs/tests/regress.0I.out b/usr.bin/xargs/tests/regress.0I.out
new file mode 100644
index 0000000..16009c0
--- /dev/null
+++ b/usr.bin/xargs/tests/regress.0I.out
@@ -0,0 +1,18 @@
+The quick ' brown quick ' brownquick ' brown quick ' brown
+The fox jumped
+over "the lazy fox jumped
+over "the lazyfox jumped
+over "the lazy fox jumped
+over "the lazy
+The
+The dog
+quick brown fox dog
+quick brown foxdog
+quick brown fox dog
+quick brown fox
+The jumped over the jumped over thejumped over the jumped over the
+The lazy dog
+ lazy dog
+lazy dog
+ lazy dog
+
diff --git a/usr.bin/xargs/tests/regress.0J.out b/usr.bin/xargs/tests/regress.0J.out
new file mode 100644
index 0000000..69c87f9
--- /dev/null
+++ b/usr.bin/xargs/tests/regress.0J.out
@@ -0,0 +1,4 @@
+The quick ' brown fox jumped
+over "the lazy dog
+quick brown fox jumped over the lazy dog
+ again.
diff --git a/usr.bin/xargs/tests/regress.0L.out b/usr.bin/xargs/tests/regress.0L.out
new file mode 100644
index 0000000..2d13fcc
--- /dev/null
+++ b/usr.bin/xargs/tests/regress.0L.out
@@ -0,0 +1,6 @@
+quick ' brown fox jumped
+over "the lazy
+dog
+quick brown fox
+jumped over the lazy dog
+
diff --git a/usr.bin/xargs/tests/regress.I.out b/usr.bin/xargs/tests/regress.I.out
new file mode 100644
index 0000000..f2a6a1e
--- /dev/null
+++ b/usr.bin/xargs/tests/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 %
diff --git a/usr.bin/xargs/tests/regress.J.out b/usr.bin/xargs/tests/regress.J.out
new file mode 100644
index 0000000..b88a41e
--- /dev/null
+++ b/usr.bin/xargs/tests/regress.J.out
@@ -0,0 +1 @@
+The quick brown fox jumped over the lazy dog again.
diff --git a/usr.bin/xargs/tests/regress.L.out b/usr.bin/xargs/tests/regress.L.out
new file mode 100644
index 0000000..7359dee
--- /dev/null
+++ b/usr.bin/xargs/tests/regress.L.out
@@ -0,0 +1,2 @@
+quick brown fox jumped over the lazy
+dog
diff --git a/usr.bin/xargs/tests/regress.R.out b/usr.bin/xargs/tests/regress.R.out
new file mode 100644
index 0000000..6fe947f
--- /dev/null
+++ b/usr.bin/xargs/tests/regress.R.out
@@ -0,0 +1,4 @@
+The quick brown % % %% % %
+The fox jumped % % %% % %
+The over the lazy % % %% % %
+The dog % % %% % %
diff --git a/usr.bin/xargs/tests/regress.in b/usr.bin/xargs/tests/regress.in
new file mode 100644
index 0000000..5252b48
--- /dev/null
+++ b/usr.bin/xargs/tests/regress.in
@@ -0,0 +1,4 @@
+quick brown
+fox jumped
+over the lazy
+dog
diff --git a/usr.bin/xargs/tests/regress.n1.out b/usr.bin/xargs/tests/regress.n1.out
new file mode 100644
index 0000000..77ef6c5
--- /dev/null
+++ b/usr.bin/xargs/tests/regress.n1.out
@@ -0,0 +1,8 @@
+quick
+brown
+fox
+jumped
+over
+the
+lazy
+dog
diff --git a/usr.bin/xargs/tests/regress.n2.out b/usr.bin/xargs/tests/regress.n2.out
new file mode 100644
index 0000000..4fa3f55
--- /dev/null
+++ b/usr.bin/xargs/tests/regress.n2.out
@@ -0,0 +1,4 @@
+quick brown
+fox jumped
+over the
+lazy dog
diff --git a/usr.bin/xargs/tests/regress.n3.out b/usr.bin/xargs/tests/regress.n3.out
new file mode 100644
index 0000000..21b2c1e
--- /dev/null
+++ b/usr.bin/xargs/tests/regress.n3.out
@@ -0,0 +1,3 @@
+quick brown fox
+jumped over the
+lazy dog
diff --git a/usr.bin/xargs/tests/regress.normal.out b/usr.bin/xargs/tests/regress.normal.out
new file mode 100644
index 0000000..458d9cb
--- /dev/null
+++ b/usr.bin/xargs/tests/regress.normal.out
@@ -0,0 +1 @@
+The quick brown fox jumped over the lazy dog
diff --git a/usr.bin/xargs/tests/regress.quotes.in b/usr.bin/xargs/tests/regress.quotes.in
new file mode 100644
index 0000000..11388a0
--- /dev/null
+++ b/usr.bin/xargs/tests/regress.quotes.in
@@ -0,0 +1,4 @@
+a 'b "c' \'d
+e\ f "g ' h"
+i\
+j
diff --git a/usr.bin/xargs/tests/regress.quotes.out b/usr.bin/xargs/tests/regress.quotes.out
new file mode 100644
index 0000000..f79ad41
--- /dev/null
+++ b/usr.bin/xargs/tests/regress.quotes.out
@@ -0,0 +1,7 @@
+a
+b "c
+'d
+e f
+g ' h
+i
+j
diff --git a/usr.bin/xargs/tests/regress.sh b/usr.bin/xargs/tests/regress.sh
new file mode 100644
index 0000000..316365d
--- /dev/null
+++ b/usr.bin/xargs/tests/regress.sh
@@ -0,0 +1,21 @@
+# $FreeBSD$
+
+echo 1..13
+
+REGRESSION_START($1)
+
+REGRESSION_TEST(`normal', `xargs echo The <${SRCDIR}/regress.in')
+REGRESSION_TEST(`I', `xargs -I% echo The % % % %% % % <${SRCDIR}/regress.in')
+REGRESSION_TEST(`J', `xargs -J% echo The % again. <${SRCDIR}/regress.in')
+REGRESSION_TEST(`L', `xargs -L3 echo <${SRCDIR}/regress.in')
+REGRESSION_TEST(`R', `xargs -I% -R1 echo The % % % %% % % <${SRCDIR}/regress.in')
+REGRESSION_TEST(`n1', `xargs -n1 echo <${SRCDIR}/regress.in')
+REGRESSION_TEST(`n2', `xargs -n2 echo <${SRCDIR}/regress.in')
+REGRESSION_TEST(`n3', `xargs -n3 echo <${SRCDIR}/regress.in')
+REGRESSION_TEST(`0', `xargs -0 -n1 echo <${SRCDIR}/regress.0.in')
+REGRESSION_TEST(`0I', `xargs -0 -I% echo The % %% % <${SRCDIR}/regress.0.in')
+REGRESSION_TEST(`0J', `xargs -0 -J% echo The % again. <${SRCDIR}/regress.0.in')
+REGRESSION_TEST(`0L', `xargs -0 -L2 echo <${SRCDIR}/regress.0.in')
+REGRESSION_TEST(`quotes', `xargs -n1 echo <${SRCDIR}/regress.quotes.in')
+
+REGRESSION_END()
OpenPOWER on IntegriCloud