]> Tony Duckles's Git Repositories (git.nynim.org) - svn2svn.git/blob - tests/Makefile
Fix typo in comment
[svn2svn.git] / tests / Makefile
1 # Run tests
2
3 SHELL_PATH ?= $(SHELL)
4 RM ?= rm -f
5 PROVE ?= prove
6 DEFAULT_TEST_TARGET ?= test
7
8 #SVN2SVN_TEST_OPTS=--verbose --debug
9 SVN2SVN_PROVE_OPTS ?= --timer --jobs 10
10
11 # Shell quote
12 SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
13
14 T = $(sort $(wildcard t[0-9][0-9][0-9][0-9]-*.sh))
15
16 all: $(DEFAULT_TEST_TARGET)
17
18 test: pre-clean $(TEST_LINT)
19 $(MAKE) aggregate-results-and-cleanup
20
21 prove: pre-clean _repo_ref $(TEST_LINT)
22 @echo "*** prove ***"; $(PROVE) --exec '$(SHELL_PATH_SQ)' $(SVN2SVN_PROVE_OPTS) $(T) :: $(SVN2SVN_TEST_OPTS)
23 $(MAKE) clean
24
25 $(T): _repo_ref
26 @echo "*** $@ ***"; '$(SHELL_PATH_SQ)' $@ $(SVN2SVN_TEST_OPTS)
27
28 _repo_ref:
29 ./make-ref-repo.sh
30
31 pre-clean:
32 $(RM) -r test-results
33
34 clean:
35 $(RM) -r test-results
36 $(RM) -r _wc_*
37 $(RM) -r _repo_t*
38
39 test-lint: test-lint-duplicates test-lint-executable
40
41 test-lint-duplicates:
42 @dups=`echo $(T) | tr ' ' '\n' | sed 's/-.*//' | sort | uniq -d` && \
43 test -z "$$dups" || { \
44 echo >&2 "duplicate test numbers:" $$dups; exit 1; }
45
46 test-lint-executable:
47 @bad=`for i in $(T); do test -x "$$i" || echo $$i; done` && \
48 test -z "$$bad" || { \
49 echo >&2 "non-executable tests:" $$bad; exit 1; }
50
51 aggregate-results-and-cleanup: $(T)
52 $(MAKE) aggregate-results
53 $(MAKE) clean
54
55 aggregate-results:
56 for f in test-results/t*-*.counts; do \
57 echo "$$f"; \
58 done | '$(SHELL_PATH_SQ)' ./aggregate-results.sh
59
60 .PHONY: pre-clean $(T) aggregate-results clean