From 3a92d97ff0f22d21608e1c19b83104c4937523b6 Mon Sep 17 00:00:00 2001 From: Julio Merino Date: Sun, 16 Mar 2014 08:04:06 +0000 Subject: Migrate most of tools/regression/usr.bin/ to the new tests layout. I'm starting with the easy cases. The leftovers need to be looked at a bit more closely. Note that this change _does_ modify the code of the old tests. This is required in order to allow the code to locate the data files in the source directory instead of the current directory, because Kyua automatically changes the latter to a temporary directory. Also note that at least one test is known to be broken here. Actually, the test is not really broken: it's marked as a TODO but unfortunately Kyua's TAP parser currently does not understand that. Will have to be fixed separately. --- usr.bin/xargs/Makefile | 6 ++++++ usr.bin/xargs/tests/Makefile | 26 ++++++++++++++++++++++++++ usr.bin/xargs/tests/legacy_test.sh | 6 ++++++ usr.bin/xargs/tests/regress.0.in | Bin 0 -> 86 bytes usr.bin/xargs/tests/regress.0.out | 8 ++++++++ usr.bin/xargs/tests/regress.0I.out | 18 ++++++++++++++++++ usr.bin/xargs/tests/regress.0J.out | 4 ++++ usr.bin/xargs/tests/regress.0L.out | 6 ++++++ usr.bin/xargs/tests/regress.I.out | 4 ++++ usr.bin/xargs/tests/regress.J.out | 1 + usr.bin/xargs/tests/regress.L.out | 2 ++ usr.bin/xargs/tests/regress.R.out | 4 ++++ usr.bin/xargs/tests/regress.in | 4 ++++ usr.bin/xargs/tests/regress.n1.out | 8 ++++++++ usr.bin/xargs/tests/regress.n2.out | 4 ++++ usr.bin/xargs/tests/regress.n3.out | 3 +++ usr.bin/xargs/tests/regress.normal.out | 1 + usr.bin/xargs/tests/regress.quotes.in | 4 ++++ usr.bin/xargs/tests/regress.quotes.out | 7 +++++++ usr.bin/xargs/tests/regress.sh | 21 +++++++++++++++++++++ 20 files changed, 137 insertions(+) create mode 100644 usr.bin/xargs/tests/Makefile create mode 100644 usr.bin/xargs/tests/legacy_test.sh create mode 100644 usr.bin/xargs/tests/regress.0.in create mode 100644 usr.bin/xargs/tests/regress.0.out create mode 100644 usr.bin/xargs/tests/regress.0I.out create mode 100644 usr.bin/xargs/tests/regress.0J.out create mode 100644 usr.bin/xargs/tests/regress.0L.out create mode 100644 usr.bin/xargs/tests/regress.I.out create mode 100644 usr.bin/xargs/tests/regress.J.out create mode 100644 usr.bin/xargs/tests/regress.L.out create mode 100644 usr.bin/xargs/tests/regress.R.out create mode 100644 usr.bin/xargs/tests/regress.in create mode 100644 usr.bin/xargs/tests/regress.n1.out create mode 100644 usr.bin/xargs/tests/regress.n2.out create mode 100644 usr.bin/xargs/tests/regress.n3.out create mode 100644 usr.bin/xargs/tests/regress.normal.out create mode 100644 usr.bin/xargs/tests/regress.quotes.in create mode 100644 usr.bin/xargs/tests/regress.quotes.out create mode 100644 usr.bin/xargs/tests/regress.sh (limited to 'usr.bin/xargs') diff --git a/usr.bin/xargs/Makefile b/usr.bin/xargs/Makefile index 642e9532e421..b627bf5e73b4 100644 --- a/usr.bin/xargs/Makefile +++ b/usr.bin/xargs/Makefile @@ -1,7 +1,13 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ +.include + PROG= xargs SRCS= xargs.c strnsubst.c +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include diff --git a/usr.bin/xargs/tests/Makefile b/usr.bin/xargs/tests/Makefile new file mode 100644 index 000000000000..2004d797f5df --- /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 diff --git a/usr.bin/xargs/tests/legacy_test.sh b/usr.bin/xargs/tests/legacy_test.sh new file mode 100644 index 000000000000..1b6b806c5980 --- /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 000000000000..448ba5367d4e Binary files /dev/null and b/usr.bin/xargs/tests/regress.0.in differ diff --git a/usr.bin/xargs/tests/regress.0.out b/usr.bin/xargs/tests/regress.0.out new file mode 100644 index 000000000000..2bc97257af69 --- /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 000000000000..16009c092b01 --- /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 000000000000..69c87f9fa52e --- /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 000000000000..2d13fcc0d388 --- /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 000000000000..f2a6a1e82e22 --- /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 000000000000..b88a41e5076b --- /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 000000000000..7359dee8f366 --- /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 000000000000..6fe947f0d9e4 --- /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 000000000000..5252b480a520 --- /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 000000000000..77ef6c555c2d --- /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 000000000000..4fa3f55161d6 --- /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 000000000000..21b2c1e97416 --- /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 000000000000..458d9cb930c4 --- /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 000000000000..11388a05b046 --- /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 000000000000..f79ad41ad0fd --- /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 000000000000..316365d95d6e --- /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() -- cgit v1.3