aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/regression/usr.bin/Makefile2
-rw-r--r--tools/regression/usr.bin/apply/Makefile4
-rw-r--r--tools/regression/usr.bin/apply/regress.00.in1
-rw-r--r--tools/regression/usr.bin/apply/regress.00.out1
-rw-r--r--tools/regression/usr.bin/apply/regress.01.out1
-rw-r--r--tools/regression/usr.bin/apply/regress.01.sh15
-rw-r--r--tools/regression/usr.bin/apply/regress.sh10
-rw-r--r--tools/regression/usr.bin/apply/regress.t6
8 files changed, 39 insertions, 1 deletions
diff --git a/tools/regression/usr.bin/Makefile b/tools/regression/usr.bin/Makefile
index 6e6d6f124b1d..c5774b2bd52f 100644
--- a/tools/regression/usr.bin/Makefile
+++ b/tools/regression/usr.bin/Makefile
@@ -1,5 +1,5 @@
# $FreeBSD$
-SUBDIR= calendar file2c join jot m4 printf sed tr uudecode uuencode xargs lastcomm
+SUBDIR= apply calendar file2c join jot m4 printf sed tr uudecode uuencode xargs lastcomm
.include <bsd.subdir.mk>
diff --git a/tools/regression/usr.bin/apply/Makefile b/tools/regression/usr.bin/apply/Makefile
new file mode 100644
index 000000000000..b937d41a4e4a
--- /dev/null
+++ b/tools/regression/usr.bin/apply/Makefile
@@ -0,0 +1,4 @@
+# $FreeBSD$
+
+all:
+ @m4 ${.CURDIR}/../regress.m4 ${.CURDIR}/regress.sh | sh /dev/stdin ${.CURDIR}
diff --git a/tools/regression/usr.bin/apply/regress.00.in b/tools/regression/usr.bin/apply/regress.00.in
new file mode 100644
index 000000000000..8282be782435
--- /dev/null
+++ b/tools/regression/usr.bin/apply/regress.00.in
@@ -0,0 +1 @@
+12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012
diff --git a/tools/regression/usr.bin/apply/regress.00.out b/tools/regression/usr.bin/apply/regress.00.out
new file mode 100644
index 000000000000..c725cb2fa98c
--- /dev/null
+++ b/tools/regression/usr.bin/apply/regress.00.out
@@ -0,0 +1 @@
+12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012
diff --git a/tools/regression/usr.bin/apply/regress.01.out b/tools/regression/usr.bin/apply/regress.01.out
new file mode 100644
index 000000000000..bcf5ab29339a
--- /dev/null
+++ b/tools/regression/usr.bin/apply/regress.01.out
@@ -0,0 +1 @@
+apply: Argument list too long
diff --git a/tools/regression/usr.bin/apply/regress.01.sh b/tools/regression/usr.bin/apply/regress.01.sh
new file mode 100644
index 000000000000..db5f1d4cd82c
--- /dev/null
+++ b/tools/regression/usr.bin/apply/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/tools/regression/usr.bin/apply/regress.sh b/tools/regression/usr.bin/apply/regress.sh
new file mode 100644
index 000000000000..7cbaae322c82
--- /dev/null
+++ b/tools/regression/usr.bin/apply/regress.sh
@@ -0,0 +1,10 @@
+# $FreeBSD$
+
+echo 1..2
+
+REGRESSION_START($1)
+
+REGRESSION_TEST(`00', `apply "echo %1 %1 %1 %1" $(cat regress.00.in)')
+REGRESSION_TEST(`01', `sh regress.01.sh')
+
+REGRESSION_END()
diff --git a/tools/regression/usr.bin/apply/regress.t b/tools/regression/usr.bin/apply/regress.t
new file mode 100644
index 000000000000..a82aacd9886f
--- /dev/null
+++ b/tools/regression/usr.bin/apply/regress.t
@@ -0,0 +1,6 @@
+#!/bin/sh
+# $FreeBSD$
+
+cd `dirname $0`
+
+m4 ../regress.m4 regress.sh | sh