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-testwithout 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 reportSo, 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)" \