tMakefile - tomb - the crypto undertaker
HTML git clone git://parazyd.org/tomb.git
DIR Log
DIR Files
DIR Refs
DIR README
DIR LICENSE
---
tMakefile (1666B)
---
1 # Run tests
2 #
3 # Copyright (c) 2011-2012 Mathias Lafeldt
4 # Copyright (c) 2005-2012 Git project
5 # Copyright (c) 2005-2012 Junio C Hamano
6 #
7 # This program is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation, either version 2 of the License, or
10 # (at your option) any later version.
11 #
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
16 #
17 # You should have received a copy of the GNU General Public License
18 # along with this program. If not, see http://www.gnu.org/licenses/ .
19
20 SHELL := /usr/bin/zsh
21 SHELL_PATH ?= $(SHELL)
22 SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
23 RM ?= rm -f
24 PROVE ?= prove
25 AGGREGATE_SCRIPT ?= aggregate-results
26 DEFAULT_TEST_TARGET ?= test
27 TEST_OPTS ?= --verbose --immediate --root=/tmp/tomb/sharness
28
29 T = $(sort $(wildcard *.sh))
30
31 all: $(DEFAULT_TEST_TARGET)
32
33 test: pre-clean
34 $(MAKE) aggregate-results-and-cleanup
35
36 prove: pre-clean
37 @echo "*** prove ***"; $(PROVE) --exec '$(SHELL_PATH_SQ)' $(PROVE_OPTS) $(T) :: $(TEST_OPTS)
38
39 $(T):
40 @echo "*** $@ ***"; '$(SHELL_PATH_SQ)' $@ $(TEST_OPTS)
41
42 pre-clean:
43 $(RM) -r test-results
44
45 clean:
46 $(RM) .prove
47
48 aggregate-results-and-cleanup: $(T)
49 $(MAKE) aggregate-results
50 $(MAKE) clean
51
52 aggregate-results:
53 for f in test-results/*.counts; do \
54 echo "$$f"; \
55 done | '$(SHELL_PATH_SQ)' '$(AGGREGATE_SCRIPT)'
56
57 .PHONY: all test prove $(T) pre-clean clean
58 .PHONY: aggregate-results-and-cleanup aggregate-results