Re: [PATCH v3 6/7] t/Makefile: run unit tests alongside shell tests
- From
Josh Steadmon <steadmon@google.com>
- Date
- Apr 11, 2024, 18:44 UTC
- Message-ID
- <ZhgvefDKhTQ6rfnD@google.com>
- In-Reply-To
- <20240327085827.GA846805@coredump.intra.peff.net>
On 2024.03.27 04:58, Jeff King wrote:
Show 28 quoted lines
> On Fri, Feb 23, 2024 at 03:33:55PM -0800, Josh Steadmon wrote:
>
> > 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.Actually, I think the "manual prove outside of the Makefile" situation is worth keeping this. I know I sometimes copy commands from Makefiles and run them manually when debugging issues, so it could be annoying for folks if we remove the default here.
Show 5 quoted lines
> 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