Thread (52 messages) 52 messages, 3 authors, 2024-05-06

Re: [PATCH v3 6/7] t/Makefile: run unit tests alongside shell tests

From: Jeff King <hidden>
Date: 2024-03-27 08:58:29

On Fri, Feb 23, 2024 at 03:33:55PM -0800, Josh Steadmon wrote:
quoted hunk ↗ jump to hunk
diff --git a/t/run-test.sh b/t/run-test.sh
new file mode 100755
index 0000000000..c29fef48dc
--- /dev/null
+++ b/t/run-test.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+# A simple wrapper to run shell tests via TEST_SHELL_PATH,
+# or exec unit tests directly.
+
+case "$1" in
+*.sh)
+	exec ${TEST_SHELL_PATH:-/bin/sh} "$@"
+	;;
+*)
+	exec "$@"
+	;;
+esac
An earlier step required that runs via "test-tool run-command" have
TEST_SHELL_PATH set correctly. So defaulting to /bin/sh here is
pointless, I'd think? This is used only for the in-Makefile "prove"
invocation, so running individual tests or even a manual "prove" outside
of the Makefile (where the user might not have set TEST_SHELL_PATH)
would not apply.

It obviously is not hurting anything, but I wonder if you'd want to have
it complain loudly to catch any instance where your assumption is not
true.

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help