Re: [PATCH v3 6/7] t/Makefile: run unit tests alongside shell tests
- From
Jeff King <peff@peff.net>
- Date
- Mar 27, 2024, 08:58 UTC
- Message-ID
- <20240327085827.GA846805@coredump.intra.peff.net>
- In-Reply-To
- <cfcc4bd427318fed1cacc8457381d5a0c408460a.1708728717.git.steadmon@google.com>
On Fri, Feb 23, 2024 at 03:33:55PM -0800, Josh Steadmon wrote:
Show 19 quoted lines
> 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 "$@"
> + ;;
> +esacAn 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