diff options
Diffstat (limited to 'usr.bin/make/tests/shell/path_select')
10 files changed, 77 insertions, 0 deletions
diff --git a/usr.bin/make/tests/shell/path_select/Makefile b/usr.bin/make/tests/shell/path_select/Makefile new file mode 100644 index 0000000..d9341b4 --- /dev/null +++ b/usr.bin/make/tests/shell/path_select/Makefile @@ -0,0 +1,17 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/make/shell/path_select + +TAP_TESTS_SH= legacy_test + +FILESDIR= ${TESTSDIR} +FILES= Makefile.test +FILES+= expected.status.1 +FILES+= expected.status.2 +FILES+= expected.stderr.1 +FILES+= expected.stderr.2 +FILES+= expected.stdout.1 +FILES+= expected.stdout.2 +FILES+= shell + +.include <bsd.test.mk> diff --git a/usr.bin/make/tests/shell/path_select/Makefile.test b/usr.bin/make/tests/shell/path_select/Makefile.test new file mode 100644 index 0000000..05cfb27 --- /dev/null +++ b/usr.bin/make/tests/shell/path_select/Makefile.test @@ -0,0 +1,31 @@ +# +# Change the path for builtin shells. There are two methods to do this. +# This is the second of them when both a path and a name are specified. +# This selects a builtin shell according to the name, but executes it +# from the specified path. +# +# Be sure to include a meta-character into the command line, so that +# really our shell is executed. +# +# $FreeBSD$ +# + +.ifmake sh_test + +.SHELL: name=sh path=${.CURDIR}/shell +sh_test: + @: This is the shell. + +.elifmake csh_test + +.SHELL: name=csh path=${.CURDIR}/shell +csh_test: + @: This is the C-shell. + +.elifmake ksh_test + +.SHELL: name=ksh path=${.CURDIR}/shell +ksh_test: + @: This is the Korn-shell. + +.endif diff --git a/usr.bin/make/tests/shell/path_select/expected.status.1 b/usr.bin/make/tests/shell/path_select/expected.status.1 new file mode 100644 index 0000000..573541a --- /dev/null +++ b/usr.bin/make/tests/shell/path_select/expected.status.1 @@ -0,0 +1 @@ +0 diff --git a/usr.bin/make/tests/shell/path_select/expected.status.2 b/usr.bin/make/tests/shell/path_select/expected.status.2 new file mode 100644 index 0000000..573541a --- /dev/null +++ b/usr.bin/make/tests/shell/path_select/expected.status.2 @@ -0,0 +1 @@ +0 diff --git a/usr.bin/make/tests/shell/path_select/expected.stderr.1 b/usr.bin/make/tests/shell/path_select/expected.stderr.1 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/usr.bin/make/tests/shell/path_select/expected.stderr.1 diff --git a/usr.bin/make/tests/shell/path_select/expected.stderr.2 b/usr.bin/make/tests/shell/path_select/expected.stderr.2 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/usr.bin/make/tests/shell/path_select/expected.stderr.2 diff --git a/usr.bin/make/tests/shell/path_select/expected.stdout.1 b/usr.bin/make/tests/shell/path_select/expected.stdout.1 new file mode 100644 index 0000000..d881364 --- /dev/null +++ b/usr.bin/make/tests/shell/path_select/expected.stdout.1 @@ -0,0 +1 @@ +-ec : This is the shell. diff --git a/usr.bin/make/tests/shell/path_select/expected.stdout.2 b/usr.bin/make/tests/shell/path_select/expected.stdout.2 new file mode 100644 index 0000000..de3fc89 --- /dev/null +++ b/usr.bin/make/tests/shell/path_select/expected.stdout.2 @@ -0,0 +1 @@ +-ec : This is the C-shell. diff --git a/usr.bin/make/tests/shell/path_select/legacy_test.sh b/usr.bin/make/tests/shell/path_select/legacy_test.sh new file mode 100644 index 0000000..6b75b90 --- /dev/null +++ b/usr.bin/make/tests/shell/path_select/legacy_test.sh @@ -0,0 +1,19 @@ +#! /bin/sh +# $FreeBSD$ + +. $(dirname $0)/../../common.sh + +# Description +DESC="New path for builtin shells (2)." + +# Setup +TEST_COPY_FILES="shell 755" + +# Run +TEST_N=3 +TEST_1="sh_test" +TEST_2="csh_test" +TEST_3="ksh_test" +TEST_3_SKIP="no ksh on FreeBSD" + +eval_cmd $* diff --git a/usr.bin/make/tests/shell/path_select/shell b/usr.bin/make/tests/shell/path_select/shell new file mode 100644 index 0000000..46169eb --- /dev/null +++ b/usr.bin/make/tests/shell/path_select/shell @@ -0,0 +1,6 @@ +#!/bin/sh +# $FreeBSD$ +echo $@ +if ! test -t 0 ; then + cat +fi |