1# Run tests
2#
3# Copyright (c) 2005 Junio C Hamano
4#
5
6-include ../config.mak.autogen
7-include ../config.mak
8
9#GIT_TEST_OPTS=--verbose --debug
10SHELL_PATH ?= $(SHELL)
11PERL_PATH ?= /usr/bin/perl
12TAR ?= $(TAR)
13RM ?= rm -f
14
15# Shell quote;
16SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
17
18T = $(wildcard t[0-9][0-9][0-9][0-9]-*.sh)
19TSVN = $(wildcard t91[0-9][0-9]-*.sh)
20TGITWEB = $(wildcard t95[0-9][0-9]-*.sh)
21
22all: pre-clean
23 $(MAKE) aggregate-results-and-cleanup
24
25$(T):
26 @echo "*** $@ ***"; GIT_CONFIG=.git/config '$(SHELL_PATH_SQ)' $@ $(GIT_TEST_OPTS)
27
28pre-clean:
29 $(RM) -r test-results
30
31clean:
32 $(RM) -r 'trash directory'.* test-results
33 $(RM) -r valgrind/bin
34 $(RM) .prove
35
36aggregate-results-and-cleanup: $(T)
37 $(MAKE) aggregate-results
38 $(MAKE) clean
39
40aggregate-results:
41 for f in test-results/t*-*.counts; do \
42 echo "$$f"; \
43 done | '$(SHELL_PATH_SQ)' ./aggregate-results.sh
44
45# we can test NO_OPTIMIZE_COMMITS independently of LC_ALL
46full-svn-test:
47 $(MAKE) $(TSVN) GIT_SVN_NO_OPTIMIZE_COMMITS=1 LC_ALL=C
48 $(MAKE) $(TSVN) GIT_SVN_NO_OPTIMIZE_COMMITS=0 LC_ALL=en_US.UTF-8
49
50gitweb-test:
51 $(MAKE) $(TGITWEB)
52
53valgrind:
54 GIT_TEST_OPTS=--valgrind $(MAKE)
55
56# Smoke testing targets
57-include ../GIT-VERSION-FILE
58uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo unknown')
59uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo unknown')
60
61test-results:
62 mkdir -p test-results
63
64test-results/git-smoke.tar.gz: test-results
65 $(PERL_PATH) ./harness \
66 --archive="test-results/git-smoke.tar.gz" \
67 $(T)
68
69smoke: test-results/git-smoke.tar.gz
70
71SMOKE_UPLOAD_FLAGS =
72ifdef SMOKE_USERNAME
73 SMOKE_UPLOAD_FLAGS += -F username="$(SMOKE_USERNAME)" -F password="$(SMOKE_PASSWORD)"
74endif
75ifdef SMOKE_COMMENT
76 SMOKE_UPLOAD_FLAGS += -F comments="$(SMOKE_COMMENT)"
77endif
78ifdef SMOKE_TAGS
79 SMOKE_UPLOAD_FLAGS += -F tags="$(SMOKE_TAGS)"
80endif
81
82smoke_report: smoke
83 curl \
84 -H "Expect: " \
85 -F project=Git \
86 -F architecture="$(uname_M)" \
87 -F platform="$(uname_S)" \
88 -F revision="$(GIT_VERSION)" \
89 -F report_file=@test-results/git-smoke.tar.gz \
90 $(SMOKE_UPLOAD_FLAGS) \
91 http://smoke.git.nix.is/app/projects/process_add_report/1 \
92 | grep -v ^Redirecting
93
94.PHONY: pre-clean $(T) aggregate-results clean valgrind smoke smoke_report