Skip to content

Commit 4739c19

Browse files
committed
Merge branch 'mg/make-prove'
* mg/make-prove: test: allow running the tests under "prove"
2 parents f5b868f + 28d836c commit 4739c19

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

t/Makefile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ SHELL_PATH ?= $(SHELL)
1111
PERL_PATH ?= /usr/bin/perl
1212
TAR ?= $(TAR)
1313
RM ?= rm -f
14+
PROVE ?= prove
15+
DEFAULT_TEST_TARGET ?= test
1416

1517
# Shell quote;
1618
SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
@@ -19,9 +21,15 @@ T = $(wildcard t[0-9][0-9][0-9][0-9]-*.sh)
1921
TSVN = $(wildcard t91[0-9][0-9]-*.sh)
2022
TGITWEB = $(wildcard t95[0-9][0-9]-*.sh)
2123

22-
all: pre-clean
24+
all: $(DEFAULT_TEST_TARGET)
25+
26+
test: pre-clean
2327
$(MAKE) aggregate-results-and-cleanup
2428

29+
prove: pre-clean
30+
@echo "*** prove ***"; GIT_CONFIG=.git/config $(PROVE) --exec '$(SHELL_PATH_SQ)' $(GIT_PROVE_OPTS) $(T) :: $(GIT_TEST_OPTS)
31+
$(MAKE) clean
32+
2533
$(T):
2634
@echo "*** $@ ***"; GIT_CONFIG=.git/config '$(SHELL_PATH_SQ)' $@ $(GIT_TEST_OPTS)
2735

t/README

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ prove and other harnesses come with a lot of useful options. The
5050
# Repeat until no more failures
5151
$ prove -j 15 --state=failed,save ./t[0-9]*.sh
5252

53+
You can give DEFAULT_TEST_TARGET=prove on the make command (or define it
54+
in config.mak) to cause "make test" to run tests under prove.
55+
GIT_PROVE_OPTS can be used to pass additional options, e.g.
56+
57+
$ make DEFAULT_TEST_TARGET=prove GIT_PROVE_OPTS='--timer --jobs 16' test
58+
5359
You can also run each test individually from command line, like this:
5460

5561
$ sh ./t3010-ls-files-killed-modified.sh

0 commit comments

Comments
 (0)