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

Re: [PATCH 1/1] Makefile: add prove and coverage-prove targets

From
Jeff King <peff@peff.net>
Date
Jan 29, 2019, 16:46 UTC
Message-ID
<20190129164654.GA6991@sigill.intra.peff.net>
In-Reply-To
<bb17112d-2869-741f-de13-3971a995032e@gmail.com>
On Tue, Jan 29, 2019 at 11:35:41AM -0500, Derrick Stolee wrote:
Show 7 quoted lines
> > For people who don't have "prove" available, I think they could just do
> > "make -k test" to make sure the full suite runs. Should we perhaps be
> > doing that automatically in the sub-make run by coverage-test?
> 
> I wanted to avoid changing the existing behavior, if I could. But, if
> we can reasonably assume that anyone running 'make coverage-test' wants
> to run the full suite even with failures, then that's fine by me.

Another option would be to relay "-k" from the caller. I think it's not enough to just use $(MAKE), but if you use $(MAKE) $(MAKEFLAGS), then running "make -k coverage-test" from your coverage script would (I think) do what you want.

> I see from the make docs that '-k' will still result in an error code
> at the end of the command, so no automation would result in an incorrect
> response to a failed test. Am I correct?

Yeah, that matches my understanding. I don't think you'd have to deal with that failure code manually for coverage-report because it does not depend on coverage-test (but obviously if you did "make coverage-test && make coverage-report", the "&&" needs to become a semicolon).

Show 12 quoted lines
> >> +coverage-prove: coverage-clean-results coverage-compile
> >> +	$(MAKE) CFLAGS="$(COVERAGE_CFLAGS)" LDFLAGS="$(COVERAGE_LDFLAGS)" \
> >> +		DEFAULT_TEST_TARGET=prove -j1 prove
> >> +
> > 
> > You probably don't need to override DEFAULT_TEST_TARGET here, since the
> > "prove" target doesn't look at it. Likewise, "-j1" probably does nothing
> > here, since prove itself is a single target.
> 
> As Szeder mentioned, I can probably just drop the 'prove' target and use
> DEFAULT_TEST_TARGET instead. Or do we think anyone will want to use
> 'make prove' from root?

Yeah, that works. I typically do run prove, and I do run the tests from the root, but DEFAULT_TEST_TARGET already makes it all work for me. So yeah, I think it's fine to leave off the prove target until somebody actually wants it.

Show 6 quoted lines
> > I'm not sure why we want to enforce -j1 for these targets, but if it's
> > important to do so for the prove case, as well, you'd need to add it to
> > GIT_PROVE_OPTS.
> 
> The '-j1' is necessary because the coverage data is collected in a way that
> is not thread-safe. Our compile options also force single-threaded behavior.
Ah, right, I vaguely recall that now.
> I'll specifically override GIT_PROVE_OPTS here to force -j1, but also send
> -j1 to the 'make' command, too.
Makes sense.
-Peff
Previous: Derrick StoleeNext: Ævar Arnfjörð Bjarmason
Message 13 of 22 in “Makefile: add prove and coverage-prove targets”
  1. 0/1 Makefile: add prove and coverage-prove targetsDerrick Stolee via GitGitGadget, Jan 29, 2019
  2. 1/1 Makefile: add prove and coverage-prove targetsDerrick Stolee via GitGitGadget, Jan 29, 2019
  3. Johannes SchindelinJan 29, 2019
  4. SZEDER GáborJan 29, 2019
  5. Derrick StoleeJan 29, 2019
  6. Jeff KingJan 29, 2019
  7. SZEDER GáborJan 29, 2019
  8. Derrick StoleeJan 29, 2019
  9. Derrick StoleeJan 29, 2019
  10. SZEDER GáborJan 29, 2019
  11. Jeff KingJan 29, 2019
  12. Derrick StoleeJan 29, 2019
  13. Jeff KingJan 29, 2019
  14. Ævar Arnfjörð BjarmasonJan 29, 2019
  15. Jeff KingJan 29, 2019
  16. Johannes SchindelinJan 30, 2019
  17. Ævar Arnfjörð BjarmasonJan 30, 2019
  18. Johannes SchindelinJan 30, 2019
  19. Ævar Arnfjörð BjarmasonJan 30, 2019
  20. Johannes SchindelinJan 31, 2019
  21. 0/1 Makefile: add prove and coverage-prove targetsDerrick Stolee via GitGitGadget, Jan 29, 2019
  22. 1/1 Makefile: add coverage-prove targetDerrick Stolee via GitGitGadget, Jan 29, 2019

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.