From owner-dev-commits-src-all@freebsd.org Sun Jan 3 22:54:14 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6E9324C217D; Sun, 3 Jan 2021 22:54:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D8DbB2Y59z4vKR; Sun, 3 Jan 2021 22:54:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2C7AA7BFE; Sun, 3 Jan 2021 22:54:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 103MsEY7071584; Sun, 3 Jan 2021 22:54:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 103MsElQ071583; Sun, 3 Jan 2021 22:54:14 GMT (envelope-from git) Date: Sun, 3 Jan 2021 22:54:14 GMT Message-Id: <202101032254.103MsElQ071583@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jilles Tjoelker Subject: git: 52981a1694be - main - sh/tests: Add a second kind of binary scripts without #! MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jilles X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 52981a1694be7a70013e5149c020706c9b6411f9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2021 22:54:14 -0000 The branch main has been updated by jilles: URL: https://cgit.FreeBSD.org/src/commit/?id=52981a1694be7a70013e5149c020706c9b6411f9 commit 52981a1694be7a70013e5149c020706c9b6411f9 Author: Jilles Tjoelker AuthorDate: 2021-01-03 20:27:50 +0000 Commit: Jilles Tjoelker CommitDate: 2021-01-03 22:53:37 +0000 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 --- bin/sh/tests/execution/Makefile | 1 + bin/sh/tests/execution/shellproc7.0 | 10 ++++++++++ 2 files changed, 11 insertions(+) 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" ]