aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorJilles Tjoelker <jilles@FreeBSD.org>2021-01-03 20:27:50 +0000
committerJilles Tjoelker <jilles@FreeBSD.org>2021-01-03 22:53:37 +0000
commit52981a1694be7a70013e5149c020706c9b6411f9 (patch)
treeb0fe1c5a7e11c97759f09a374fe160fb785a3322 /bin
parentc949ba1d202c6e939e71f1cb555958b8de3dd048 (diff)
downloadsrc-52981a1694be7a70013e5149c020706c9b6411f9.tar.gz
src-52981a1694be7a70013e5149c020706c9b6411f9.zip
sh/tests: Add a second kind of binary scripts without #!
One of the reasons for git commit e0f5c1387df23c8c4811f5b24a7ef6ecac51a71a was to make "actually portable executables" work. Add a test that is more like those. MFC after: 1 week
Diffstat (limited to 'bin')
-rw-r--r--bin/sh/tests/execution/Makefile1
-rw-r--r--bin/sh/tests/execution/shellproc7.010
2 files changed, 11 insertions, 0 deletions
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
@@ -63,6 +63,7 @@ ${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
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" ]