git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] t/Makefile: retain cache t/.prove across prove runs
@ 2012-05-02 15:31 mhagger
  2012-05-02 16:07 ` Jeff King
  0 siblings, 1 reply; 5+ messages in thread
From: mhagger @ 2012-05-02 15:31 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Michael Haggerty

From: Michael Haggerty <mhagger@alum.mit.edu>

prove(1) can write a summary of its test results and timings into a
cache file, t/.prove, then use this information during later runs for
various purposes.  But deleting t/.prove after every test run defeats
this purpose.  So do not delete t/.prove as part of "make
DEFAILT_TEST_TARGET=prove test".  (Continue to delete the file on
"make clean".)

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
---
prove(1) can be told to retain information about test runs, and to use
it for interesting purposes during future invocations.  For example,
it can be told to run tests that failed during the last run:

    GIT_PROVE_OPTS = --state=failed,save

or that have failed recently:

    GIT_PROVE_OPTS = --state=hot,save

or that have been edited since the last run of prove:

    GIT_PROVE_OPTS = --state=fresh,save

It can also run tests in parallel, and start them in order from
slowest to fastest, which, combined with running tests in parallel,
can improve CPU utilization:

    GIT_PROVE_OPTS = --timer --jobs 5 --state=slow,save

(On my 4-core notebook, the latter speeds up the tests by about 10%
compared to running them in parallel in numerical order.)

 t/Makefile |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/t/Makefile b/t/Makefile
index 6091211..88e289f 100644
--- a/t/Makefile
+++ b/t/Makefile
@@ -28,7 +28,7 @@ test: pre-clean $(TEST_LINT)
 
 prove: pre-clean $(TEST_LINT)
 	@echo "*** prove ***"; GIT_CONFIG=.git/config $(PROVE) --exec '$(SHELL_PATH_SQ)' $(GIT_PROVE_OPTS) $(T) :: $(GIT_TEST_OPTS)
-	$(MAKE) clean
+	$(MAKE) clean-except-prove-cache
 
 $(T):
 	@echo "*** $@ ***"; GIT_CONFIG=.git/config '$(SHELL_PATH_SQ)' $@ $(GIT_TEST_OPTS)
@@ -36,9 +36,11 @@ $(T):
 pre-clean:
 	$(RM) -r test-results
 
-clean:
+clean-except-prove-cache:
 	$(RM) -r 'trash directory'.* test-results
 	$(RM) -r valgrind/bin
+
+clean: clean-except-prove-cache
 	$(RM) .prove
 
 test-lint: test-lint-duplicates test-lint-executable
-- 
1.7.10

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-05-20 21:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-02 15:31 [PATCH] t/Makefile: retain cache t/.prove across prove runs mhagger
2012-05-02 16:07 ` Jeff King
2012-05-19 14:54   ` Michael Haggerty
2012-05-19 15:27     ` Jeff King
2012-05-20 21:18     ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).