From: mhagger@alum.mit.edu Date: Wed, 02 May 2012 15:31:52 GMT Subject: [PATCH] t/Makefile: retain cache t/.prove across prove runs Message-ID: <1335972712-20621-1-git-send-email-mhagger@alum.mit.edu> From: Michael Haggerty 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 --- 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