Subject: Re: [PATCH v2 2/6] t: extend test_lazy_prereq

From: Patrick Steinhardt <[email-masked]>
Date: Wed, 12 Mar 2025 08:01:04 +0100

On Tue, Mar 11, 2025 at 02:25:01PM -0700, Junio C Hamano wrote:
> 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?

> @@ -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 "
>  			esac

Hm, 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