Skip to content

Commit 9ccab75

Browse files
krobelusgitster
authored andcommitted
t/perf: do not run tests in user's $SHELL
The environment variable $SHELL is usually set to the user's interactive shell. Our build and test scripts never use $SHELL because there are no guarantees about its input language. Instead, we use /bin/sh which should be a POSIX shell. For systems with a broken /bin/sh, we allow to override that path via SHELL_PATH. To run tests in yet another shell we allow to override SHELL_PATH with TEST_SHELL_PATH. Perf tests run in $SHELL via a wrapper defined in t/perf/perf-lib.sh, so they break with e.g. SHELL=python. Use TEST_SHELL_PATH like in other tests. TEST_SHELL_PATH is always defined because t/perf/perf-lib.sh includes t/test-lib.sh, which includes GIT-BUILD-OPTIONS. Acked-by: Jeff King <[email protected]> Signed-off-by: Johannes Altmanninger <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e9d7761 commit 9ccab75

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

t/perf/perf-lib.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ test_run_perf_ () {
161161
test_cleanup=:
162162
test_export_="test_cleanup"
163163
export test_cleanup test_export_
164-
"$GTIME" -f "%E %U %S" -o test_time.$i "$SHELL" -c '
164+
"$GTIME" -f "%E %U %S" -o test_time.$i "$TEST_SHELL_PATH" -c '
165165
. '"$TEST_DIRECTORY"/test-lib-functions.sh'
166166
test_export () {
167167
test_export_="$test_export_ $*"

0 commit comments

Comments
 (0)