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

Re: [RFC PATCH] Makefile: new prove target for running the tests with TAP

From
Jeff King <peff@peff.net>
Date
Oct 14, 2010, 17:23 UTC
Message-ID
<20101014172301.GA2770@sigill.intra.peff.net>
In-Reply-To
<5c46df95f93b56aa2fce56c7efe7b2be80642c8b.1287045908.git.git@drmicha.warpmail.net>
On Thu, Oct 14, 2010 at 10:53:36AM +0200, Michael J Gruber wrote:
> +prove: pre-clean
> +	@echo "*** prove ***"; GIT_CONFIG=.git/config $(PROVE) --exec '$(SHELL_PATH_SQ)' $(GIT_PROVE_OPTS) $(T) :: $(GIT_TEST_OPTS)
> +	$(MAKE) clean
> +

I like the idea. I think the prove output is a little nicer for things like -j16, but it's a pain to construct the command line (especially as I use --root in GIT_TEST_OPTS to get a significant speedup).

I wonder if anybody is really interested in switching between the "prove" and regular test targets, though. I would think you either like to use prove or not. So perhaps it makes more sense to put a configurable switch for the default target, like the patch below. Then you can just "make test" (or "make" in the test directory) as usual.

diff --git a/t/Makefile b/t/Makefile
index c7baefb..2b4d4ac 100644
--- a/t/Makefile
+++ b/t/Makefile
@@ -11,6 +11,8 @@ SHELL_PATH ?= $(SHELL)
 PERL_PATH ?= /usr/bin/perl
 TAR ?= $(TAR)
 RM ?= rm -f
+PROVE ?= prove
+DEFAULT_TEST_TARGET ?= test
 
 # Shell quote;
 SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
@@ -18,9 +20,15 @@ SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
 T = $(wildcard t[0-9][0-9][0-9][0-9]-*.sh)
 TSVN = $(wildcard t91[0-9][0-9]-*.sh)
 
-all: pre-clean
+all: $(DEFAULT_TEST_TARGET)
+
+test: pre-clean
 	$(MAKE) aggregate-results-and-cleanup
 
+prove: pre-clean
+	@echo "*** prove ***"; GIT_CONFIG=.git/config $(PROVE) --exec '$(SHELL_PATH_SQ)' $(GIT_PROVE_OPTS) $(T) :: $(GIT_TEST_OPTS)
+	$(MAKE) clean
+
 $(T):
 	@echo "*** $@ ***"; GIT_CONFIG=.git/config '$(SHELL_PATH_SQ)' $@ $(GIT_TEST_OPTS)
 
Previous: Jonathan NiederNext: Junio C Hamano
Message 6 of 10 in “Makefile: new prove target for running the tests with TAP”
  1. Makefile: new prove target for running the tests with TAPMichael J Gruber, Oct 14, 2010
  2. Ævar Arnfjörð BjarmasonOct 14, 2010
  3. Michael J GruberOct 14, 2010
  4. Ævar Arnfjörð BjarmasonOct 14, 2010
  5. Jonathan NiederOct 14, 2010
  6. Jeff KingOct 14, 2010
  7. Junio C HamanoOct 27, 2010
  8. Jeff KingOct 27, 2010
  9. Ævar Arnfjörð BjarmasonOct 27, 2010
  10. Michael J GruberOct 29, 2010

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.