git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] t0450: fix test for out-of-tree builds

From
Patrick Steinhardt <ps@pks.im>
Date
Aug 4, 2025, 07:56 UTC
Message-ID
<aJBnuOcQQ1AY6hR4@pks.im>
In-Reply-To
<20250804073002.1586332-1-toon@iotcl.com>
On Mon, Aug 04, 2025 at 09:30:02AM +0200, Toon Claes wrote:
Show 23 quoted lines
> When using Meson, builds are out-of-tree and $GIT_BUILD_DIR gets set to
> the path where the build output is landing. To locate the Documentation
> sources, test 't0450' was using that path.
> 
> Modify test 't0450' to use `$GIT_SOURCE_DIR/Documentation` to find the
> documentation sources.
> 
> Signed-off-by: Toon Claes <toon@iotcl.com>
> ---
>  t/t0450-txt-doc-vs-help.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/t/t0450-txt-doc-vs-help.sh b/t/t0450-txt-doc-vs-help.sh
> index 2f7504ae7e..da2d0af5b0 100755
> --- a/t/t0450-txt-doc-vs-help.sh
> +++ b/t/t0450-txt-doc-vs-help.sh
> @@ -41,7 +41,7 @@ help_to_synopsis () {
>  }
>  
>  builtin_to_adoc () {
> -       echo "$GIT_BUILD_DIR/Documentation/git-$1.adoc"
> +       echo "$GIT_SOURCE_DIR/Documentation/git-$1.adoc"
>  }

Ok, the change itself looks reasonable to me. One question that the commit message doesn't answer though is why this didn't cause the test to fail. I think the answer is that we have the following loop:

	while read builtin
	do
		...
		adoc="$(builtin_to_adoc "$builtin")" &&
		preq="$(echo BUILTIN_ADOC_$builtin | tr '[:lower:]-' '[:upper:]_')" &&
		if test -f "$adoc"
		then
			test_set_prereq "$preq"
		fi &&
		...
	done <builtins

So we explicitly check wether the ".adoc" file exists, and if it doesn't we don't have its prereq. All subsequent tests then use that prereq, so we skip all of those tests with Meson entirely.

Which indicates that this prereq is overly loose: ideally we should not skip such tests, but rather print an error that something is fishy. I suspect that we have the prereq in place because there are some builtins that don't have a corresponding manpage though.

Maybe this is something we could explore: what breaks if we remove the prereq entirely? And if this breakage is limited to a small number of builtins we can maybe use an explicit skip-list like we already do with "t/t0450/adoc-help-mismatches".

Thanks!
Patrick
Previous: Toon ClaesNext: Toon Claes
Message 2 of 12 in “t0450: fix test for out-of-tree builds”
  1. t0450: fix test for out-of-tree buildsToon Claes, Aug 4, 2025
  2. Patrick SteinhardtAug 4, 2025
  3. Toon ClaesAug 5, 2025
  4. 0/2 Harden test t0450-txt-doc-vs-helpToon Claes, Aug 8, 2025
  5. 1/2 t0450: fix test for out-of-tree buildsToon Claes, Aug 8, 2025
  6. 2/2 t0450: add allowlist for builtins with missing .adocToon Claes, Aug 8, 2025
  7. Junio C HamanoAug 8, 2025
  8. Patrick SteinhardtAug 12, 2025
  9. Junio C HamanoAug 28, 2025
  10. Junio C HamanoSep 2, 2025
  11. Toon ClaesSep 3, 2025
  12. Junio C HamanoSep 3, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.