3 # Copyright (c) 2005 Junio C Hamano
6 -include ..
/config.mak.autogen
9 #GIT_TEST_OPTS=--verbose --debug
10 SHELL_PATH ?
= $(SHELL
)
11 PERL_PATH ?
= /usr
/bin
/perl
15 DEFAULT_TEST_TARGET ?
= test
18 SHELL_PATH_SQ
= $(subst ','\'',$(SHELL_PATH))
20 T = $(wildcard t[0-9][0-9][0-9][0-9]-*.sh)
21 TSVN = $(wildcard t91[0-9][0-9]-*.sh)
22 TGITWEB = $(wildcard t95[0-9][0-9]-*.sh)
24 all: $(DEFAULT_TEST_TARGET)
26 test: pre-clean $(TEST_LINT)
27 $(MAKE) aggregate-results-and-cleanup
29 prove: pre-clean $(TEST_LINT)
30 @echo "*** prove ***"; GIT_CONFIG=.git/config $(PROVE) --exec '$(SHELL_PATH_SQ
)' $(GIT_PROVE_OPTS) $(T) :: $(GIT_TEST_OPTS)
34 @echo "*** $@ ***"; GIT_CONFIG=.git/config '$(SHELL_PATH_SQ
)' $@ $(GIT_TEST_OPTS)
40 $(RM) -r 'trash directory
'.* test-results
44 test-lint: test-lint-duplicates test-lint-executable
47 @dups=`echo $(T) | tr ' ' '\n' | sed 's
/-.
*//' | sort | uniq -d` && \
48 test -z "$$dups" || { \
49 echo >&2 "duplicate test numbers:" $$dups; exit 1; }
52 @bad=`for i in $(T); do test -x "$$i" || echo $$i; done` && \
53 test -z "$$bad" || { \
54 echo >&2 "non-executable tests:" $$bad; exit 1; }
56 aggregate-results-and-cleanup: $(T)
57 $(MAKE) aggregate-results
61 for f in test-results/t*-*.counts; do \
63 done | '$(SHELL_PATH_SQ
)' ./aggregate-results.sh
65 # we can test NO_OPTIMIZE_COMMITS independently of LC_ALL
67 $(MAKE) $(TSVN) GIT_SVN_NO_OPTIMIZE_COMMITS=1 LC_ALL=C
68 $(MAKE) $(TSVN) GIT_SVN_NO_OPTIMIZE_COMMITS=0 LC_ALL=en_US.UTF-8
74 $(MAKE) GIT_TEST_OPTS="$(GIT_TEST_OPTS) --valgrind"
76 .PHONY: pre-clean $(T) aggregate-results clean valgrind