]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t/t0000-basic: make sure subtests also use TEST_SHELL_PATH
authorCarlo Marcelo Arenas Belón <carenas@gmail.com>
Thu, 7 May 2020 01:07:46 +0000 (18:07 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 7 May 2020 20:01:32 +0000 (13:01 -0700)
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>
t/t0000-basic.sh

index b6566003dd8704503305314767f84d516c170f7a..a221f9faf518179fd7f70f7ed1927b0506aee42b 100755 (executable)
@@ -78,9 +78,7 @@ _run_sub_test_lib_test_common () {
                # the sub-test.
                sane_unset HARNESS_ACTIVE &&
                cd "$name" &&
-               cat >"$name.sh" <<-EOF &&
-               #!$SHELL_PATH
-
+               write_script "$name.sh" "$TEST_SHELL_PATH" <<-EOF &&
                test_description='$descr (run in sub test-lib)
 
                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 () {
                . "\$TEST_DIRECTORY"/test-lib.sh
                EOF
                cat >>"$name.sh" &&
-               chmod +x "$name.sh" &&
                export TEST_DIRECTORY &&
                TEST_OUTPUT_DIRECTORY=$(pwd) &&
                export TEST_OUTPUT_DIRECTORY &&
@@ -103,7 +100,7 @@ _run_sub_test_lib_test_common () {
                then
                        ./"$name.sh" "$@" >out 2>err
                else
-                       !  ./"$name.sh" "$@" >out 2>err
+                       ! ./"$name.sh" "$@" >out 2>err
                fi
        )
 }