2007-07-16 08:35:52 +04:00
|
|
|
LEVEL = ../../..
|
|
|
|
include $(LEVEL)/Makefile.common
|
2007-07-11 21:01:13 +04:00
|
|
|
|
2008-08-29 03:28:16 +04:00
|
|
|
# Test in all immediate subdirectories if unset.
|
|
|
|
TESTDIRS ?= $(shell echo $(PROJ_SRC_DIR)/*/)
|
2008-03-10 22:32:31 +03:00
|
|
|
|
|
|
|
# Only run rewriter tests on darwin.
|
|
|
|
ifeq ($(OS),Darwin)
|
2008-06-17 01:21:48 +04:00
|
|
|
TESTDIRS +=
|
2008-03-10 22:32:31 +03:00
|
|
|
endif
|
|
|
|
|
2008-04-07 02:32:01 +04:00
|
|
|
ifdef VERBOSE
|
2009-03-13 03:21:49 +03:00
|
|
|
ifeq ($(VERBOSE),0)
|
|
|
|
PROGRESS = :
|
2009-03-13 03:41:24 +03:00
|
|
|
REPORTFAIL = echo 'FAIL: clang' $(TARGET_TRIPLE) $(subst $(LLVM_SRC_ROOT)/tools/clang/,,$<)
|
2009-03-13 03:21:49 +03:00
|
|
|
else
|
2008-04-07 02:32:01 +04:00
|
|
|
PROGRESS = echo $<
|
|
|
|
REPORTFAIL = cat $@
|
2009-03-13 03:21:49 +03:00
|
|
|
endif
|
2008-04-07 02:32:01 +04:00
|
|
|
DONE = true
|
|
|
|
else
|
|
|
|
PROGRESS = printf '.'
|
|
|
|
REPORTFAIL = (echo; echo '----' $< 'failed ----')
|
|
|
|
DONE = echo
|
|
|
|
endif
|
|
|
|
|
2008-12-01 22:23:47 +03:00
|
|
|
TESTS := $(addprefix Output/, $(addsuffix .testresults, $(shell find $(TESTDIRS) \( -name '*.c' -or -name '*.cpp' -or -name '*.m' -or -name '*.mm' -or -name '*.S' \) | grep -v "Output/")))
|
2008-04-07 02:32:01 +04:00
|
|
|
Output/%.testresults: %
|
|
|
|
@ $(PROGRESS)
|
2008-08-21 07:03:44 +04:00
|
|
|
@ PATH=$(ToolDir):$(LLVM_SRC_ROOT)/test/Scripts:$$PATH VG=$(VG) $(PROJ_SRC_DIR)/TestRunner.sh $< > $@ || $(REPORTFAIL)
|
2008-04-07 02:32:01 +04:00
|
|
|
|
2007-07-16 08:35:52 +04:00
|
|
|
all::
|
2008-04-07 02:32:01 +04:00
|
|
|
@ mkdir -p $(addprefix Output/, $(TESTDIRS))
|
|
|
|
@ rm -f $(TESTS)
|
2009-03-13 03:41:24 +03:00
|
|
|
@ echo '--- Running clang tests for $(TARGET_TRIPLE) ---'
|
2008-04-07 02:32:01 +04:00
|
|
|
@ $(MAKE) $(TESTS)
|
|
|
|
@ $(DONE)
|
2008-09-17 22:08:07 +04:00
|
|
|
@ !(cat $(TESTS) | grep -q " FAILED! ")
|
2008-04-07 02:32:01 +04:00
|
|
|
|
|
|
|
report: $(TESTS)
|
|
|
|
@ cat $^
|
2008-03-18 10:03:00 +03:00
|
|
|
|
|
|
|
clean::
|
2008-03-20 17:28:22 +03:00
|
|
|
@ rm -rf Output/
|
2008-03-18 10:03:00 +03:00
|
|
|
|
2008-04-07 02:32:01 +04:00
|
|
|
.PHONY: all report clean
|