Gabor Greif | 021e970 | 2008-03-15 07:26:41 +0000 | [diff] [blame] | 1 | LEVEL = ../../.. |
2 | include $(LEVEL)/Makefile.common | ||||
3 | |||||
Gabor Greif | 021e970 | 2008-03-15 07:26:41 +0000 | [diff] [blame] | 4 | TESTDIRS = CodeGen Lexer Preprocessor Parser Sema Analysis Serialization |
5 | |||||
6 | # Only run rewriter tests on darwin. | ||||
7 | ifeq ($(OS),Darwin) | ||||
8 | TESTDIRS += Rewriter | ||||
9 | endif | ||||
10 | |||||
Gabor Greif | 119c65d | 2008-03-17 16:29:58 +0000 | [diff] [blame] | 11 | ifdef VERBOSE |
12 | PROGRESS = echo $< | ||||
13 | REPORTFAIL = cat $@ | ||||
Gabor Greif | b4992db | 2008-03-17 18:36:14 +0000 | [diff] [blame] | 14 | DONE = true |
Gabor Greif | 119c65d | 2008-03-17 16:29:58 +0000 | [diff] [blame] | 15 | else |
16 | PROGRESS = printf '.' | ||||
17 | REPORTFAIL = (echo; echo '----' $< 'failed ----') | ||||
Gabor Greif | b4992db | 2008-03-17 18:36:14 +0000 | [diff] [blame] | 18 | DONE = echo |
Gabor Greif | 119c65d | 2008-03-17 16:29:58 +0000 | [diff] [blame] | 19 | endif |
20 | |||||
Gabor Greif | 65307dc | 2008-03-20 08:09:10 +0000 | [diff] [blame] | 21 | TESTS := $(addprefix Output/, $(addsuffix .testresults, $(shell find $(TESTDIRS) \( -name '*.c' -or -name '*.cpp' -or -name '*.m' \)))) |
Gabor Greif | 021e970 | 2008-03-15 07:26:41 +0000 | [diff] [blame] | 22 | |
Gabor Greif | e1d2647 | 2008-03-17 15:58:58 +0000 | [diff] [blame] | 23 | Output/%.testresults: % |
Gabor Greif | 119c65d | 2008-03-17 16:29:58 +0000 | [diff] [blame] | 24 | @ $(PROGRESS) |
Gabor Greif | 1e2db03 | 2008-03-20 22:50:54 +0000 | [diff] [blame] | 25 | @ PATH=$$PATH:$(ToolDir):$(LLVM_SRC_ROOT)/test/Scripts VG=$(VG) ./TestRunner.sh $< > $@ || $(REPORTFAIL) |
Gabor Greif | 021e970 | 2008-03-15 07:26:41 +0000 | [diff] [blame] | 26 | |
Gabor Greif | 53c5567 | 2008-03-17 15:37:09 +0000 | [diff] [blame] | 27 | all:: |
Gabor Greif | 17feadf | 2008-03-18 07:03:00 +0000 | [diff] [blame] | 28 | @ mkdir -p $(addprefix Output/, $(TESTDIRS)) |
Gabor Greif | e1d2647 | 2008-03-17 15:58:58 +0000 | [diff] [blame] | 29 | @ rm -f $(TESTS) |
Gabor Greif | 5ca1b5a | 2008-03-17 12:35:00 +0000 | [diff] [blame] | 30 | @ echo '--- Running clang tests ---' |
Gabor Greif | 53c5567 | 2008-03-17 15:37:09 +0000 | [diff] [blame] | 31 | @ $(MAKE) -f Makefile.parallel $(TESTS) |
Gabor Greif | b4992db | 2008-03-17 18:36:14 +0000 | [diff] [blame] | 32 | @ $(DONE) |
Gabor Greif | 021e970 | 2008-03-15 07:26:41 +0000 | [diff] [blame] | 33 | |
Gabor Greif | 53c5567 | 2008-03-17 15:37:09 +0000 | [diff] [blame] | 34 | report: $(TESTS) |
35 | @ cat $^ | ||||
Gabor Greif | 021e970 | 2008-03-15 07:26:41 +0000 | [diff] [blame] | 36 | |
Gabor Greif | 17feadf | 2008-03-18 07:03:00 +0000 | [diff] [blame] | 37 | clean:: |
Gabor Greif | 5267d7c | 2008-03-20 14:28:22 +0000 | [diff] [blame] | 38 | @ rm -rf Output/ |
Gabor Greif | 17feadf | 2008-03-18 07:03:00 +0000 | [diff] [blame] | 39 | |
40 | .PHONY: all report clean |