diff --git a/bin/sh/tests/execution/Makefile b/bin/sh/tests/execution/Makefile index cfc21caf3791..ab5218b10a0c 100644 --- a/bin/sh/tests/execution/Makefile +++ b/bin/sh/tests/execution/Makefile @@ -1,74 +1,75 @@ # $FreeBSD$ PACKAGE= tests TESTSDIR= ${TESTSBASE}/bin/sh/${.CURDIR:T} .PATH: ${.CURDIR:H} ATF_TESTS_SH= functional_test ${PACKAGE}FILES+= bg1.0 ${PACKAGE}FILES+= bg2.0 ${PACKAGE}FILES+= bg3.0 ${PACKAGE}FILES+= bg4.0 ${PACKAGE}FILES+= bg5.0 ${PACKAGE}FILES+= bg6.0 bg6.0.stdout ${PACKAGE}FILES+= bg7.0 ${PACKAGE}FILES+= bg8.0 ${PACKAGE}FILES+= bg9.0 ${PACKAGE}FILES+= bg10.0 bg10.0.stdout ${PACKAGE}FILES+= bg11.0 ${PACKAGE}FILES+= bg12.0 ${PACKAGE}FILES+= bg13.0 ${PACKAGE}FILES+= env1.0 ${PACKAGE}FILES+= fork1.0 ${PACKAGE}FILES+= fork2.0 ${PACKAGE}FILES+= fork3.0 ${PACKAGE}FILES+= func1.0 ${PACKAGE}FILES+= func2.0 ${PACKAGE}FILES+= func3.0 ${PACKAGE}FILES+= hash1.0 ${PACKAGE}FILES+= int-cmd1.0 ${PACKAGE}FILES+= killed1.0 ${PACKAGE}FILES+= killed2.0 ${PACKAGE}FILES+= not1.0 ${PACKAGE}FILES+= not2.0 ${PACKAGE}FILES+= path1.0 ${PACKAGE}FILES+= pipefail1.0 ${PACKAGE}FILES+= pipefail2.42 ${PACKAGE}FILES+= pipefail3.42 ${PACKAGE}FILES+= pipefail4.42 ${PACKAGE}FILES+= pipefail5.42 ${PACKAGE}FILES+= pipefail6.42 ${PACKAGE}FILES+= pipefail7.0 ${PACKAGE}FILES+= redir1.0 ${PACKAGE}FILES+= redir2.0 ${PACKAGE}FILES+= redir3.0 ${PACKAGE}FILES+= redir4.0 ${PACKAGE}FILES+= redir5.0 ${PACKAGE}FILES+= redir6.0 ${PACKAGE}FILES+= redir7.0 ${PACKAGE}FILES+= set-C1.0 ${PACKAGE}FILES+= set-n1.0 ${PACKAGE}FILES+= set-n2.0 ${PACKAGE}FILES+= set-n3.0 ${PACKAGE}FILES+= set-n4.0 ${PACKAGE}FILES+= set-x1.0 ${PACKAGE}FILES+= set-x2.0 ${PACKAGE}FILES+= set-x3.0 ${PACKAGE}FILES+= set-x4.0 ${PACKAGE}FILES+= shellproc1.0 ${PACKAGE}FILES+= shellproc2.0 ${PACKAGE}FILES+= shellproc3.0 ${PACKAGE}FILES+= shellproc4.0 ${PACKAGE}FILES+= shellproc5.0 ${PACKAGE}FILES+= shellproc6.0 +${PACKAGE}FILES+= shellproc7.0 ${PACKAGE}FILES+= subshell1.0 subshell1.0.stdout ${PACKAGE}FILES+= subshell2.0 ${PACKAGE}FILES+= subshell3.0 ${PACKAGE}FILES+= subshell4.0 ${PACKAGE}FILES+= unknown1.0 ${PACKAGE}FILES+= unknown2.0 ${PACKAGE}FILES+= var-assign1.0 .include diff --git a/bin/sh/tests/execution/shellproc7.0 b/bin/sh/tests/execution/shellproc7.0 new file mode 100644 index 000000000000..2a99ae74c151 --- /dev/null +++ b/bin/sh/tests/execution/shellproc7.0 @@ -0,0 +1,10 @@ +# $FreeBSD$ +# Non-POSIX trickery that is widely supported, +# used by https://justine.lol/ape.html + +T=`mktemp -d "${TMPDIR:-/tmp}/sh-test.XXXXXXXX"` || exit +trap 'rm -rf "${T}"' 0 +printf "MZqFpD='\n\0'\n#'\"\necho this is a test\n" >"$T/testshellproc" +chmod 755 "$T/testshellproc" +PATH=$T:$PATH +[ "`testshellproc`" = "this is a test" ]