Makefile: whitespace style fixes in macro definitions
[git/git.git] / t / Makefile
CommitLineData
e1970ce4
JH
1# Run tests
2#
3# Copyright (c) 2005 Junio C Hamano
4#
d6928ebd 5
b2b0026e 6-include ../config.mak.autogen
c14417c4
JK
7-include ../config.mak
8
dd6fc7ca 9#GIT_TEST_OPTS = --verbose --debug
edde7a8b 10SHELL_PATH ?= $(SHELL)
4678a5cd 11PERL_PATH ?= /usr/bin/perl
455a7f32 12TAR ?= $(TAR)
4cb08df5 13RM ?= rm -f
28d836c8
MG
14PROVE ?= prove
15DEFAULT_TEST_TARGET ?= test
e1970ce4 16
4769948a 17# Shell quote;
39c015c5 18SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
4769948a 19
aae5239b
KS
20T = $(sort $(wildcard t[0-9][0-9][0-9][0-9]-*.sh))
21TSVN = $(sort $(wildcard t91[0-9][0-9]-*.sh))
22TGITWEB = $(sort $(wildcard t95[0-9][0-9]-*.sh))
e1970ce4 23
28d836c8
MG
24all: $(DEFAULT_TEST_TARGET)
25
d38732c2 26test: pre-clean $(TEST_LINT)
e3df89a4 27 $(MAKE) aggregate-results-and-cleanup
23fc63bf 28
d38732c2 29prove: pre-clean $(TEST_LINT)
28d836c8 30 @echo "*** prove ***"; GIT_CONFIG=.git/config $(PROVE) --exec '$(SHELL_PATH_SQ)' $(GIT_PROVE_OPTS) $(T) :: $(GIT_TEST_OPTS)
60f26f63 31 $(MAKE) clean-except-prove-cache
28d836c8 32
23fc63bf 33$(T):
9c3796fc 34 @echo "*** $@ ***"; GIT_CONFIG=.git/config '$(SHELL_PATH_SQ)' $@ $(GIT_TEST_OPTS)
e1970ce4 35
f8d5ffc2
SR
36pre-clean:
37 $(RM) -r test-results
38
60f26f63 39clean-except-prove-cache:
81db4abf 40 $(RM) -r 'trash directory'.* test-results
34b383e7 41 $(RM) -r valgrind/bin
60f26f63
MH
42
43clean: clean-except-prove-cache
9a3028b9 44 $(RM) .prove
23fc63bf 45
d38732c2
JK
46test-lint: test-lint-duplicates test-lint-executable
47
48test-lint-duplicates:
49 @dups=`echo $(T) | tr ' ' '\n' | sed 's/-.*//' | sort | uniq -d` && \
50 test -z "$$dups" || { \
51 echo >&2 "duplicate test numbers:" $$dups; exit 1; }
52
53test-lint-executable:
54 @bad=`for i in $(T); do test -x "$$i" || echo $$i; done` && \
55 test -z "$$bad" || { \
56 echo >&2 "non-executable tests:" $$bad; exit 1; }
57
e3df89a4
JS
58aggregate-results-and-cleanup: $(T)
59 $(MAKE) aggregate-results
60 $(MAKE) clean
61
f8d5ffc2 62aggregate-results:
7ea3ddf8 63 for f in test-results/t*-*.counts; do \
6508eedf
BC
64 echo "$$f"; \
65 done | '$(SHELL_PATH_SQ)' ./aggregate-results.sh
f8d5ffc2 66
60d02ccc
EW
67# we can test NO_OPTIMIZE_COMMITS independently of LC_ALL
68full-svn-test:
ed92f170 69 $(MAKE) $(TSVN) GIT_SVN_NO_OPTIMIZE_COMMITS=1 LC_ALL=C
b9c85187 70 $(MAKE) $(TSVN) GIT_SVN_NO_OPTIMIZE_COMMITS=0 LC_ALL=en_US.UTF-8
60d02ccc 71
958a8467
JN
72gitweb-test:
73 $(MAKE) $(TGITWEB)
74
7f6fdea1 75valgrind:
7ef4d6b9 76 $(MAKE) GIT_TEST_OPTS="$(GIT_TEST_OPTS) --valgrind"
7f6fdea1 77
342e9ef2
TR
78perf:
79 $(MAKE) -C perf/ all
80
81# Smoke testing targets
82-include ../GIT-VERSION-FILE
83uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo unknown')
84uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo unknown')
85
86test-results:
87 mkdir -p test-results
88
89test-results/git-smoke.tar.gz: test-results
90 $(PERL_PATH) ./harness \
91 --archive="test-results/git-smoke.tar.gz" \
92 $(T)
93
94smoke: test-results/git-smoke.tar.gz
95
96SMOKE_UPLOAD_FLAGS =
97ifdef SMOKE_USERNAME
98 SMOKE_UPLOAD_FLAGS += -F username="$(SMOKE_USERNAME)" -F password="$(SMOKE_PASSWORD)"
99endif
100ifdef SMOKE_COMMENT
101 SMOKE_UPLOAD_FLAGS += -F comments="$(SMOKE_COMMENT)"
102endif
103ifdef SMOKE_TAGS
104 SMOKE_UPLOAD_FLAGS += -F tags="$(SMOKE_TAGS)"
105endif
106
107smoke_report: smoke
108 curl \
109 -H "Expect: " \
110 -F project=Git \
111 -F architecture="$(uname_M)" \
112 -F platform="$(uname_S)" \
113 -F revision="$(GIT_VERSION)" \
114 -F report_file=@test-results/git-smoke.tar.gz \
115 $(SMOKE_UPLOAD_FLAGS) \
116 http://smoke.git.nix.is/app/projects/process_add_report/1 \
117 | grep -v ^Redirecting
118
119.PHONY: pre-clean $(T) aggregate-results clean valgrind perf