aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/bmake/tests/shell/replace
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/bmake/tests/shell/replace')
-rw-r--r--usr.bin/bmake/tests/shell/replace/Makefile16
-rw-r--r--usr.bin/bmake/tests/shell/replace/Makefile.depend10
-rw-r--r--usr.bin/bmake/tests/shell/replace/Makefile.test20
-rw-r--r--usr.bin/bmake/tests/shell/replace/expected.status.11
-rw-r--r--usr.bin/bmake/tests/shell/replace/expected.status.21
-rw-r--r--usr.bin/bmake/tests/shell/replace/expected.stderr.10
-rw-r--r--usr.bin/bmake/tests/shell/replace/expected.stderr.20
-rw-r--r--usr.bin/bmake/tests/shell/replace/expected.stdout.13
-rw-r--r--usr.bin/bmake/tests/shell/replace/expected.stdout.26
-rw-r--r--usr.bin/bmake/tests/shell/replace/legacy_test.sh16
-rw-r--r--usr.bin/bmake/tests/shell/replace/shell5
11 files changed, 78 insertions, 0 deletions
diff --git a/usr.bin/bmake/tests/shell/replace/Makefile b/usr.bin/bmake/tests/shell/replace/Makefile
new file mode 100644
index 000000000000..e2e7ad948db2
--- /dev/null
+++ b/usr.bin/bmake/tests/shell/replace/Makefile
@@ -0,0 +1,16 @@
+PACKAGE= tests
+
+TESTSDIR= ${TESTSBASE}/usr.bin/bmake/shell/replace
+
+TAP_TESTS_SH= legacy_test
+
+${PACKAGE}FILES+= Makefile.test
+${PACKAGE}FILES+= expected.status.1
+${PACKAGE}FILES+= expected.status.2
+${PACKAGE}FILES+= expected.stderr.1
+${PACKAGE}FILES+= expected.stderr.2
+${PACKAGE}FILES+= expected.stdout.1
+${PACKAGE}FILES+= expected.stdout.2
+${PACKAGE}FILES+= shell
+
+.include <bsd.test.mk>
diff --git a/usr.bin/bmake/tests/shell/replace/Makefile.depend b/usr.bin/bmake/tests/shell/replace/Makefile.depend
new file mode 100644
index 000000000000..11aba52f82cf
--- /dev/null
+++ b/usr.bin/bmake/tests/shell/replace/Makefile.depend
@@ -0,0 +1,10 @@
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.bin/bmake/tests/shell/replace/Makefile.test b/usr.bin/bmake/tests/shell/replace/Makefile.test
new file mode 100644
index 000000000000..d0076b598214
--- /dev/null
+++ b/usr.bin/bmake/tests/shell/replace/Makefile.test
@@ -0,0 +1,20 @@
+#
+# Test that we can replace the shell and set all the shell parameters
+# (except meta and builtin which have their own test). This is done by
+# using a shell script for the shell that echoes all command line
+# arguments and its standard input. The shell name should not be one of
+# the builtin shells.
+#
+# XXX There seems to be a problem here in -j1 mode: for the line without
+# @- make should switch on echoing again, but it doesn't.
+#
+
+.SHELL: name="shell" path="${.CURDIR}/shell" \
+ quiet="be quiet" echo="be verbose" filter="be verbose" \
+ echoFlag="x" errFlag="y" \
+ hasErrCtl=y check="check errors" ignore="ignore errors"
+
+.PHONY: test1
+test1:
+ -@funny $$
+ funnier $$
diff --git a/usr.bin/bmake/tests/shell/replace/expected.status.1 b/usr.bin/bmake/tests/shell/replace/expected.status.1
new file mode 100644
index 000000000000..573541ac9702
--- /dev/null
+++ b/usr.bin/bmake/tests/shell/replace/expected.status.1
@@ -0,0 +1 @@
+0
diff --git a/usr.bin/bmake/tests/shell/replace/expected.status.2 b/usr.bin/bmake/tests/shell/replace/expected.status.2
new file mode 100644
index 000000000000..573541ac9702
--- /dev/null
+++ b/usr.bin/bmake/tests/shell/replace/expected.status.2
@@ -0,0 +1 @@
+0
diff --git a/usr.bin/bmake/tests/shell/replace/expected.stderr.1 b/usr.bin/bmake/tests/shell/replace/expected.stderr.1
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/usr.bin/bmake/tests/shell/replace/expected.stderr.1
diff --git a/usr.bin/bmake/tests/shell/replace/expected.stderr.2 b/usr.bin/bmake/tests/shell/replace/expected.stderr.2
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/usr.bin/bmake/tests/shell/replace/expected.stderr.2
diff --git a/usr.bin/bmake/tests/shell/replace/expected.stdout.1 b/usr.bin/bmake/tests/shell/replace/expected.stdout.1
new file mode 100644
index 000000000000..eff99ea17ab2
--- /dev/null
+++ b/usr.bin/bmake/tests/shell/replace/expected.stdout.1
@@ -0,0 +1,3 @@
+-c funny $
+funnier $
+-ec funnier $
diff --git a/usr.bin/bmake/tests/shell/replace/expected.stdout.2 b/usr.bin/bmake/tests/shell/replace/expected.stdout.2
new file mode 100644
index 000000000000..c79a09af2916
--- /dev/null
+++ b/usr.bin/bmake/tests/shell/replace/expected.stdout.2
@@ -0,0 +1,6 @@
+-yx
+be quiet
+ignore errors
+funny $
+check errors
+funnier $
diff --git a/usr.bin/bmake/tests/shell/replace/legacy_test.sh b/usr.bin/bmake/tests/shell/replace/legacy_test.sh
new file mode 100644
index 000000000000..6e672d57b607
--- /dev/null
+++ b/usr.bin/bmake/tests/shell/replace/legacy_test.sh
@@ -0,0 +1,16 @@
+#! /bin/sh
+
+. $(dirname $0)/../../common.sh
+
+# Description
+DESC="Check that the shell can be replaced."
+
+# Setup
+TEST_COPY_FILES="shell 755"
+
+# Run
+TEST_N=2
+TEST_1=
+TEST_2=-j2
+
+eval_cmd $*
diff --git a/usr.bin/bmake/tests/shell/replace/shell b/usr.bin/bmake/tests/shell/replace/shell
new file mode 100644
index 000000000000..4363618a2f36
--- /dev/null
+++ b/usr.bin/bmake/tests/shell/replace/shell
@@ -0,0 +1,5 @@
+#!/bin/sh
+echo $@
+if ! test -t 0 ; then
+ cat
+fi