LEVEL = ../../..
include $(LEVEL)/Makefile.common
-AWK = awk
-
TESTDIRS = CodeGen Lexer Preprocessor Parser Sema Analysis Serialization
# Only run rewriter tests on darwin.
TESTDIRS += Rewriter
endif
+TESTS = $(addsuffix .testresults, $(shell find $(TESTDIRS) \( -name '*.c' -or -name '*.cpp' -or -name '*.m' \)))
Makefile.tests:
@ echo '%.testresults: %' > $@
@ echo "^@ printf '.'" | tr "^" "\t" >> $@
@ echo "^@ PATH=$$PATH:$(ToolDir):$(LLVM_SRC_ROOT)/test/Scripts ./TestRunner.sh &< > &@ || (echo; echo '----' &! 'failed ----')" | tr '^!&' '\t^$$' >> $@
@ echo >> $@
- @ echo "TESTS =" \\ >> $@
- @ find $(TESTDIRS) \
- \( -name '*.c' -or -name '*.cpp' -or -name '*.m' \) \
- | $(AWK) '{print " " $$0 ".testresults \\"}' >> $@
+ @ echo "TESTS = $(TESTS)" >> $@
@ echo ' ' >> $@
@ echo >> $@
@ echo "all:: &(TESTS)" | tr "&" '$$' >> $@
all:: Makefile.tests
@ echo '--- Running clang tests ---'
@ $(MAKE) -f $< clean
- @ $(MAKE) -f $< all report
+ @ $(MAKE) -f $< all
+ @ echo "^@ echo" | tr "^" "\t" >> $@
+ @ $(MAKE) -f $< report
@ $(MAKE) -f $< clean
@ rm $<