Chris Lattner | 1467e03 | 2007-07-16 04:35:52 +0000 | [diff] [blame] | 1 | LEVEL = ../../.. |
| 2 | include $(LEVEL)/Makefile.common |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 3 | |
Eli Friedman | 7627725 | 2008-06-07 23:20:33 +0000 | [diff] [blame] | 4 | TESTDIRS = CodeGen Lexer Preprocessor Parser Sema Analysis Serialization Rewriter |
Chris Lattner | 15bd799 | 2008-03-10 19:32:31 +0000 | [diff] [blame] | 5 | |
| 6 | # Only run rewriter tests on darwin. |
| 7 | ifeq ($(OS),Darwin) |
Ted Kremenek | dd536bf | 2008-06-16 21:21:48 +0000 | [diff] [blame] | 8 | TESTDIRS += |
Chris Lattner | 15bd799 | 2008-03-10 19:32:31 +0000 | [diff] [blame] | 9 | endif |
| 10 | |
Chris Lattner | 9d294b9 | 2008-04-06 22:32:01 +0000 | [diff] [blame] | 11 | ifdef VERBOSE |
| 12 | PROGRESS = echo $< |
| 13 | REPORTFAIL = cat $@ |
| 14 | DONE = true |
| 15 | else |
| 16 | PROGRESS = printf '.' |
| 17 | REPORTFAIL = (echo; echo '----' $< 'failed ----') |
| 18 | DONE = echo |
| 19 | endif |
| 20 | |
| 21 | TESTS := $(addprefix Output/, $(addsuffix .testresults, $(shell find $(TESTDIRS) \( -name '*.c' -or -name '*.cpp' -or -name '*.m' \)))) |
| 22 | |
| 23 | Output/%.testresults: % |
| 24 | @ $(PROGRESS) |
| 25 | @ PATH=$$PATH:$(ToolDir):$(LLVM_SRC_ROOT)/test/Scripts VG=$(VG) ./TestRunner.sh $< > $@ || $(REPORTFAIL) |
| 26 | |
Chris Lattner | 1467e03 | 2007-07-16 04:35:52 +0000 | [diff] [blame] | 27 | all:: |
Chris Lattner | 9d294b9 | 2008-04-06 22:32:01 +0000 | [diff] [blame] | 28 | @ mkdir -p $(addprefix Output/, $(TESTDIRS)) |
| 29 | @ rm -f $(TESTS) |
| 30 | @ echo '--- Running clang tests ---' |
| 31 | @ $(MAKE) $(TESTS) |
| 32 | @ $(DONE) |
| 33 | |
| 34 | report: $(TESTS) |
| 35 | @ cat $^ |
Gabor Greif | 17feadf | 2008-03-18 07:03:00 +0000 | [diff] [blame] | 36 | |
| 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 | |
Chris Lattner | 9d294b9 | 2008-04-06 22:32:01 +0000 | [diff] [blame] | 40 | .PHONY: all report clean |