aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorHartmut Brandt <harti@FreeBSD.org>2005-05-20 14:50:30 +0000
committerHartmut Brandt <harti@FreeBSD.org>2005-05-20 14:50:30 +0000
commitc9302692e64bf7c67ee67e2abff8b794a9c37717 (patch)
tree2b673b0b13058d0918544a5d9f7d0f7d3943d69d /tools
parentf9424570079b25e9135121f0855c6c17bc30add9 (diff)
downloadsrc-c9302692e64bf7c67ee67e2abff8b794a9c37717.tar.gz
src-c9302692e64bf7c67ee67e2abff8b794a9c37717.zip
Add a test that test whether we can replace the shell to use by
make with another shell and set all its parameters (meta and builtins not tested here).
Notes
Notes: svn path=/head/; revision=146449
Diffstat (limited to 'tools')
-rw-r--r--tools/regression/usr.bin/make/shell/replace/Makefile33
-rw-r--r--tools/regression/usr.bin/make/shell/replace/expected.status1
-rw-r--r--tools/regression/usr.bin/make/shell/replace/expected.stderr1
-rw-r--r--tools/regression/usr.bin/make/shell/replace/expected.stdout0
-rw-r--r--tools/regression/usr.bin/make/shell/replace/sh.sh6
-rw-r--r--tools/regression/usr.bin/make/shell/replace/test.t13
6 files changed, 54 insertions, 0 deletions
diff --git a/tools/regression/usr.bin/make/shell/replace/Makefile b/tools/regression/usr.bin/make/shell/replace/Makefile
new file mode 100644
index 000000000000..f903f374646c
--- /dev/null
+++ b/tools/regression/usr.bin/make/shell/replace/Makefile
@@ -0,0 +1,33 @@
+#
+# 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.
+#
+# $FreeBSD$
+
+all: shell
+ ${MAKE} test1
+ ${MAKE} -j1 test1
+
+shell: sh.sh
+ @cp ${.CURDIR}/sh.sh ${.OBJDIR}/shell
+ @chmod +x ${.OBJDIR}/shell
+
+.ifmake test1
+
+.SHELL: name="shell" path="${.OBJDIR}/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 $$
+
+.endif
diff --git a/tools/regression/usr.bin/make/shell/replace/expected.status b/tools/regression/usr.bin/make/shell/replace/expected.status
new file mode 100644
index 000000000000..0cfbf08886fc
--- /dev/null
+++ b/tools/regression/usr.bin/make/shell/replace/expected.status
@@ -0,0 +1 @@
+2
diff --git a/tools/regression/usr.bin/make/shell/replace/expected.stderr b/tools/regression/usr.bin/make/shell/replace/expected.stderr
new file mode 100644
index 000000000000..628ea8fef6c7
--- /dev/null
+++ b/tools/regression/usr.bin/make/shell/replace/expected.stderr
@@ -0,0 +1 @@
+make: don't know how to make sh.sh. Stop
diff --git a/tools/regression/usr.bin/make/shell/replace/expected.stdout b/tools/regression/usr.bin/make/shell/replace/expected.stdout
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/tools/regression/usr.bin/make/shell/replace/expected.stdout
diff --git a/tools/regression/usr.bin/make/shell/replace/sh.sh b/tools/regression/usr.bin/make/shell/replace/sh.sh
new file mode 100644
index 000000000000..46169eb6efc2
--- /dev/null
+++ b/tools/regression/usr.bin/make/shell/replace/sh.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+# $FreeBSD$
+echo $@
+if ! test -t 0 ; then
+ cat
+fi
diff --git a/tools/regression/usr.bin/make/shell/replace/test.t b/tools/regression/usr.bin/make/shell/replace/test.t
new file mode 100644
index 000000000000..838a60579643
--- /dev/null
+++ b/tools/regression/usr.bin/make/shell/replace/test.t
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+# $FreeBSD$
+
+cd `dirname $0`
+. ../../common.sh
+
+desc_test()
+{
+ echo "Check that the shell can be replaced."
+}
+
+eval_cmd $1