summaryrefslogtreecommitdiffstats
path: root/usr.bin/apply
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/apply
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/apply')
-rw-r--r--usr.bin/apply/Makefile6
-rw-r--r--usr.bin/apply/tests/Makefile14
-rw-r--r--usr.bin/apply/tests/legacy_test.sh6
-rw-r--r--usr.bin/apply/tests/regress.00.in1
-rw-r--r--usr.bin/apply/tests/regress.00.out1
-rw-r--r--usr.bin/apply/tests/regress.01.out1
-rw-r--r--usr.bin/apply/tests/regress.01.sh15
-rw-r--r--usr.bin/apply/tests/regress.sh10
8 files changed, 54 insertions, 0 deletions
diff --git a/usr.bin/apply/Makefile b/usr.bin/apply/Makefile
index c23d928..bf37b9c 100644
--- a/usr.bin/apply/Makefile
+++ b/usr.bin/apply/Makefile
@@ -1,8 +1,14 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
# $FreeBSD$
+.include <bsd.own.mk>
+
PROG= apply
DPADD= ${LIBSBUF}
LDADD= -lsbuf
+.if ${MK_TESTS} != "no"
+SUBDIR+= tests
+.endif
+
.include <bsd.prog.mk>
diff --git a/usr.bin/apply/tests/Makefile b/usr.bin/apply/tests/Makefile
new file mode 100644
index 0000000..332bf7d
--- /dev/null
+++ b/usr.bin/apply/tests/Makefile
@@ -0,0 +1,14 @@
+# $FreeBSD$
+
+TESTSDIR= ${TESTSBASE}/usr.bin/apply
+
+TAP_TESTS_SH= legacy_test
+
+FILESDIR= ${TESTSDIR}
+FILES= regress.00.in
+FILES+= regress.00.out
+FILES+= regress.01.out
+FILES+= regress.01.sh
+FILES+= regress.sh
+
+.include <bsd.test.mk>
diff --git a/usr.bin/apply/tests/legacy_test.sh b/usr.bin/apply/tests/legacy_test.sh
new file mode 100644
index 0000000..1b6b806
--- /dev/null
+++ b/usr.bin/apply/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/apply/tests/regress.00.in b/usr.bin/apply/tests/regress.00.in
new file mode 100644
index 0000000..8282be7
--- /dev/null
+++ b/usr.bin/apply/tests/regress.00.in
@@ -0,0 +1 @@
+12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012
diff --git a/usr.bin/apply/tests/regress.00.out b/usr.bin/apply/tests/regress.00.out
new file mode 100644
index 0000000..c725cb2
--- /dev/null
+++ b/usr.bin/apply/tests/regress.00.out
@@ -0,0 +1 @@
+12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012
diff --git a/usr.bin/apply/tests/regress.01.out b/usr.bin/apply/tests/regress.01.out
new file mode 100644
index 0000000..bcf5ab2
--- /dev/null
+++ b/usr.bin/apply/tests/regress.01.out
@@ -0,0 +1 @@
+apply: Argument list too long
diff --git a/usr.bin/apply/tests/regress.01.sh b/usr.bin/apply/tests/regress.01.sh
new file mode 100644
index 0000000..db5f1d4
--- /dev/null
+++ b/usr.bin/apply/tests/regress.01.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+# $FreeBSD$
+
+SHELL=/bin/sh; export SHELL
+
+ARG_MAX=$(getconf ARG_MAX)
+ARG_MAX_HALF=$((ARG_MAX / 2))
+
+apply 'echo %1 %1 %1' $(jot $ARG_MAX_HALF 1 1 | tr -d '\n') 2>&1
+
+if [ $? -eq 0 ]; then
+ return 1
+else
+ return 0
+fi
diff --git a/usr.bin/apply/tests/regress.sh b/usr.bin/apply/tests/regress.sh
new file mode 100644
index 0000000..0a20d50
--- /dev/null
+++ b/usr.bin/apply/tests/regress.sh
@@ -0,0 +1,10 @@
+# $FreeBSD$
+
+echo 1..2
+
+REGRESSION_START($1)
+
+REGRESSION_TEST(`00', `apply "echo %1 %1 %1 %1" $(cat ${SRCDIR}/regress.00.in)')
+REGRESSION_TEST(`01', `sh ${SRCDIR}/regress.01.sh')
+
+REGRESSION_END()
OpenPOWER on IntegriCloud