blob: 0963fee542ca04e73acab2a9bd32669fd57974ff [file] [log] [blame]
Chris Lattner1467e032007-07-16 04:35:52 +00001LEVEL = ../../..
2include $(LEVEL)/Makefile.common
Reid Spencer5f016e22007-07-11 17:01:13 +00003
Daniel Dunbar852119e2008-08-28 23:28:16 +00004# Test in all immediate subdirectories if unset.
5TESTDIRS ?= $(shell echo $(PROJ_SRC_DIR)/*/)
Chris Lattner15bd7992008-03-10 19:32:31 +00006
7# Only run rewriter tests on darwin.
8ifeq ($(OS),Darwin)
Ted Kremenekdd536bf2008-06-16 21:21:48 +00009TESTDIRS +=
Chris Lattner15bd7992008-03-10 19:32:31 +000010endif
11
Chris Lattner9d294b92008-04-06 22:32:01 +000012ifdef VERBOSE
13PROGRESS = echo $<
14REPORTFAIL = cat $@
15DONE = true
16else
17PROGRESS = printf '.'
18REPORTFAIL = (echo; echo '----' $< 'failed ----')
19DONE = echo
20endif
21
Anders Carlsson413ad8b2008-08-23 21:03:10 +000022TESTS := $(addprefix Output/, $(addsuffix .testresults, $(shell find $(TESTDIRS) \( -name '*.c' -or -name '*.cpp' -or -name '*.m' -or -name '*.mm' \))))
Chris Lattner9d294b92008-04-06 22:32:01 +000023Output/%.testresults: %
24 @ $(PROGRESS)
Daniel Dunbar45659382008-08-21 03:03:44 +000025 @ PATH=$(ToolDir):$(LLVM_SRC_ROOT)/test/Scripts:$$PATH VG=$(VG) $(PROJ_SRC_DIR)/TestRunner.sh $< > $@ || $(REPORTFAIL)
Chris Lattner9d294b92008-04-06 22:32:01 +000026
Chris Lattner1467e032007-07-16 04:35:52 +000027all::
Chris Lattner9d294b92008-04-06 22:32:01 +000028 @ mkdir -p $(addprefix Output/, $(TESTDIRS))
29 @ rm -f $(TESTS)
30 @ echo '--- Running clang tests ---'
31 @ $(MAKE) $(TESTS)
32 @ $(DONE)
Daniel Dunbar4e6153b2008-09-17 18:08:07 +000033 @ !(cat $(TESTS) | grep -q " FAILED! ")
Chris Lattner9d294b92008-04-06 22:32:01 +000034
35report: $(TESTS)
36 @ cat $^
Gabor Greif17feadf2008-03-18 07:03:00 +000037
38clean::
Gabor Greif5267d7c2008-03-20 14:28:22 +000039 @ rm -rf Output/
Gabor Greif17feadf2008-03-18 07:03:00 +000040
Chris Lattner9d294b92008-04-06 22:32:01 +000041.PHONY: all report clean