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

Re: [PATCH v3] Makefile: add a prerequisite to the coverage-report target

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 14, 2022, 05:16 UTC
Message-ID
<xmqqlew82qjp.fsf@gitster.g>
In-Reply-To
<20220414022513.31465-1-gitter.spiros@gmail.com>
Elia Pinto <gitter.spiros@gmail.com> writes:
Show 9 quoted lines
> @@ -3421,13 +3422,18 @@ coverage-compile:
>  coverage-test: coverage-clean-results coverage-compile
>  	$(MAKE) CFLAGS="$(COVERAGE_CFLAGS)" LDFLAGS="$(COVERAGE_LDFLAGS)" \
>  		DEFAULT_TEST_TARGET=test -j1 test
> +	touch coverage-test.made
> +
> +coverage-test.made:
> +	@make coverage-test
> +	touch coverage-test.made

As this target runs "$(MAKE) coverage-test", at the end of which the .made file is touched anyway, I wonder if we need the second line here.

I just tried to run this sequence:
    $ make distclean
    $ make coverage-report
    $ make coverage-report
    $ make coverage-test

without the "touch" in the recipe for the coverage-test.made target, and it behaved as I expected them to, i.e.

    * got an pristine tree
    * built, ran tests and showed report
    * showed report without building or running testing
    * cleared the gcov files, ran tests and showed report
So, perhaps this patch on top?
Thanks.
 Makefile | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git i/Makefile w/Makefile
index fa8cc86276..72ae7fa886 100644
--- i/Makefile
+++ w/Makefile
@@ -3416,8 +3416,7 @@ coverage-test: coverage-clean-results coverage-compile
 	touch coverage-test.made
 
 coverage-test.made:
-	@make coverage-test
-	touch coverage-test.made
+	$(MAKE) coverage-test
 
 coverage-prove: coverage-clean-results coverage-compile
 	$(MAKE) CFLAGS="$(COVERAGE_CFLAGS)" LDFLAGS="$(COVERAGE_LDFLAGS)" \
Previous: Junio C Hamano
Message 3 of 3 in “Makefile: add a prerequisite to the coverage-report target”
  1. Makefile: add a prerequisite to the coverage-report targetElia Pinto, Apr 14, 2022
  2. Junio C HamanoApr 14, 2022
  3. Junio C HamanoApr 14, 2022

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.