@matheusbsbs / matheus-bagliano / commits / 0555e4af58
Fork 0

t/t0000-basic: make sure subtests also use TEST_SHELL_PATH

3f824e91c8 (t/Makefile: introduce TEST_SHELL_PATH, 2017-12-08) allows for setting a shell for running the tests, but the generated subtests weren't updated. Correct that and while at it update it to use write_script. Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com> Acked-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Carlo Marcelo Arenas Belón committed May 6, 2020 at 18:07 UTC 0555e4af58a93497698f2d2015a05f63ac9b75f4
1 file changed +2 -5
t/t0000-basic.sh
+2 -5
@@ -78,9 +78,7 @@ _run_sub_test_lib_test_common () {
78 # the sub-test.
79 sane_unset HARNESS_ACTIVE &&
80 cd "$name" &&
81 - cat >"$name.sh" <<-EOF &&
82 - #!$SHELL_PATH
83 -
81 + write_script "$name.sh" "$TEST_SHELL_PATH" <<-EOF &&
82 test_description='$descr (run in sub test-lib)
83
84 This is run in a sub test-lib so that we do not get incorrect
@@ -95,7 +93,6 @@ _run_sub_test_lib_test_common () {
93 . "\$TEST_DIRECTORY"/test-lib.sh
94 EOF
95 cat >>"$name.sh" &&
98 - chmod +x "$name.sh" &&
96 export TEST_DIRECTORY &&
97 TEST_OUTPUT_DIRECTORY=$(pwd) &&
98 export TEST_OUTPUT_DIRECTORY &&
@@ -103,7 +100,7 @@ _run_sub_test_lib_test_common () {
100 then
101 ./"$name.sh" "$@" >out 2>err
102 else
106 - ! ./"$name.sh" "$@" >out 2>err
103 + ! ./"$name.sh" "$@" >out 2>err
104 fi
105 )
106 }