Re: [PATCH v2 2/6] t: extend test_lazy_prereq
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Mar 12, 2025, 07:01 UTC
- Message-ID
- <Z9ExMHf9CkcDwEt1@pks.im>
- In-Reply-To
- <20250311212505.2920181-3-gitster@pobox.com>
On Tue, Mar 11, 2025 at 02:25:01PM -0700, Junio C Hamano wrote:
Show 13 quoted lines
> diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh > index 79377bc0fc..16eaaaf4c3 100644 > --- a/t/test-lib-functions.sh > +++ b/t/test-lib-functions.sh > @@ -773,6 +773,8 @@ mkdir -p "$TRASH_DIRECTORY/prereq-test-dir-'"$1"'" && > rm -rf "$TRASH_DIRECTORY/prereq-test-dir-$1" > if test "$eval_ret" = 0; then > say >&3 "prerequisite $1 ok" > + elif test "$eval_ret" = 125; then > + :; > else > say >&3 "prerequisite $1 not satisfied" > fi
The semicolon in ":;" threw me off a bit. Am I missing why we need it or is it superfluous?
Show 10 quoted lines
> @@ -811,6 +813,9 @@ test_have_prereq () {
> if test_run_lazy_prereq_ "$prerequisite" "$script"
> then
> test_set_prereq $prerequisite
> + elif test $? = 125
> + then
> + BUG "Do not use $prerequisite"
> fi
> lazily_tested_prereq="$lazily_tested_prereq$prerequisite "
> esacHm, okay. It feels quite close to overthinking the whole deprecation cycle around prerequisites as it's nothing that we tend to do very often. But on the other hand the implementation is trivial enough, so I don't mind it much.
Patrick