t/Makefile: add a rule to re-run previously-failed tests
[gitweb.git] / t / Makefile
index d613935f1455440843920e1f040b1e97ff3f27dd..1bb06c36f22d9fa0fb01fb8dfad02ffa9f338ebd 100644 (file)
@@ -35,6 +35,12 @@ all: $(DEFAULT_TEST_TARGET)
 test: pre-clean $(TEST_LINT)
        $(MAKE) aggregate-results-and-cleanup
 
+failed:
+       @failed=$$(cd '$(TEST_RESULTS_DIRECTORY_SQ)' && \
+               grep -l '^failed [1-9]' *.counts | \
+               sed -n 's/\.counts$$/.sh/p') && \
+       test -z "$$failed" || $(MAKE) $$failed
+
 prove: pre-clean $(TEST_LINT)
        @echo "*** prove ***"; $(PROVE) --exec '$(SHELL_PATH_SQ)' $(GIT_PROVE_OPTS) $(T) :: $(GIT_TEST_OPTS)
        $(MAKE) clean-except-prove-cache