git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: mhagger@alum.mit.edu
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Michael Haggerty <mhagger@alum.mit.edu>
Subject: [PATCH] t/Makefile: retain cache t/.prove across prove runs
Date: Wed,  2 May 2012 17:31:52 +0200	[thread overview]
Message-ID: <1335972712-20621-1-git-send-email-mhagger@alum.mit.edu> (raw)

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

             reply	other threads:[~2012-05-02 15:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-02 15:31 mhagger [this message]
2012-05-02 16:07 ` [PATCH] t/Makefile: retain cache t/.prove across prove runs Jeff King
2012-05-19 14:54   ` Michael Haggerty
2012-05-19 15:27     ` Jeff King
2012-05-20 21:18     ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1335972712-20621-1-git-send-email-mhagger@alum.mit.edu \
    --to=mhagger@alum.mit.edu \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).