From: Johannes Altmanninger <aclopte@gmail.com>
To: aclopte@gmail.com
Cc: git@vger.kernel.org, gitster@pobox.com, l.s.r@web.de
Subject: [PATCH] t/perf: do not run tests in user's $SHELL
Date: Thu, 7 Oct 2021 20:47:16 +0200 [thread overview]
Message-ID: <20211007184716.1187677-1-aclopte@gmail.com> (raw)
In-Reply-To: <20211002112640.hrn2ojndhoa2dd4c@gmail.com>
The environment variable $SHELL is usually set to the user's
interactive shell. We never use that shell for build and test scripts
because it might not be a POSIX shell.
Perf tests are run inside $SHELL via a wrapper defined in
t/perf/perf-lib.sh. Use $TEST_SHELL_PATH like elsewhere.
Signed-off-by: Johannes Altmanninger <aclopte@gmail.com>
---
Regarding the inconsistency around $(SHELL) in Makefiles: we could do
something like
-SHELL_PATH ?= $(SHELL)
+SHELL_PATH ?= /bin/sh
+SHELL = $(SHELL_PATH)
in some Makefiles. Though the upside (consistency & slightly easier to build
with broken /bin/sh) seems fairly low, so I'd leave it be.
t/perf/perf-lib.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/perf/perf-lib.sh b/t/perf/perf-lib.sh
index f5ed092ee5..e6b59ecbf7 100644
--- a/t/perf/perf-lib.sh
+++ b/t/perf/perf-lib.sh
@@ -157,7 +157,7 @@ test_run_perf_ () {
test_cleanup=:
test_export_="test_cleanup"
export test_cleanup test_export_
- "$GTIME" -f "%E %U %S" -o test_time.$i "$SHELL" -c '
+ "$GTIME" -f "%E %U %S" -o test_time.$i "$TEST_SHELL_PATH" -c '
. '"$TEST_DIRECTORY"/test-lib-functions.sh'
test_export () {
test_export_="$test_export_ $*"
--
2.33.0.rc2.dirty
next prev parent reply other threads:[~2021-10-07 18:47 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-02 9:40 [PATCH] perf: fix test_export with SHELL=zsh René Scharfe
2021-10-02 11:26 ` Johannes Altmanninger
2021-10-07 18:47 ` Johannes Altmanninger [this message]
2021-10-08 3:07 ` [PATCH] t/perf: do not run tests in user's $SHELL Jeff King
2021-10-08 5:34 ` Johannes Altmanninger
2021-10-08 5:41 ` Jeff King
2021-10-02 21:02 ` [PATCH] perf: fix test_export with SHELL=zsh brian m. carlson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211007184716.1187677-1-aclopte@gmail.com \
--to=aclopte@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=l.s.r@web.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).