git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] t/t0000-basic: make sure subtests also use TEST_SHELL_PATH
@ 2020-05-07  1:07 Carlo Marcelo Arenas Belón
  2020-05-07 11:39 ` Jeff King
  0 siblings, 1 reply; 2+ messages in thread
From: Carlo Marcelo Arenas Belón @ 2020-05-07  1:07 UTC (permalink / raw)
  To: git; +Cc: peff, gitster, Carlo Marcelo Arenas Belón

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>
---
 t/t0000-basic.sh | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/t/t0000-basic.sh b/t/t0000-basic.sh
index 3e440c078d..272f75ce63 100755
--- a/t/t0000-basic.sh
+++ b/t/t0000-basic.sh
@@ -77,9 +77,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
@@ -94,7 +92,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 &&
@@ -102,7 +99,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
 	)
 }
-- 
2.26.2.686.gfaf46a9ccd


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] t/t0000-basic: make sure subtests also use TEST_SHELL_PATH
  2020-05-07  1:07 [PATCH] t/t0000-basic: make sure subtests also use TEST_SHELL_PATH Carlo Marcelo Arenas Belón
@ 2020-05-07 11:39 ` Jeff King
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff King @ 2020-05-07 11:39 UTC (permalink / raw)
  To: Carlo Marcelo Arenas Belón; +Cc: git, gitster

On Wed, May 06, 2020 at 06:07:46PM -0700, Carlo Marcelo Arenas Belón wrote:

> 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.

Yeah, this makes sense. The primary benefit of $TEST_SHELL_PATH was to
get better support for special testing options (like using bash's
trace_fd with "-x"). But based on recent patches I guess you were
wanting to test the behavior of an unusual shell. And if we're testing
how the test framework runs, certainly using TEST_SHELL_PATH is the most
sensible thing.

-Peff

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-05-07 11:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-07  1:07 [PATCH] t/t0000-basic: make sure subtests also use TEST_SHELL_PATH Carlo Marcelo Arenas Belón
2020-05-07 11:39 ` Jeff King

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).