[cfe-commits] r48391 - /cfe/trunk/test/Makefile.parallel
Gabor Greif
ggreif at gmail.com
Sat Mar 15 00:26:41 PDT 2008
Author: ggreif
Date: Sat Mar 15 02:26:41 2008
New Revision: 48391
URL: http://llvm.org/viewvc/llvm-project?rev=48391&view=rev
Log:
First draft of a parallelized test methodology. Improvements soon.
Added:
cfe/trunk/test/Makefile.parallel
- copied, changed from r48341, cfe/trunk/test/Makefile
Copied: cfe/trunk/test/Makefile.parallel (from r48341, cfe/trunk/test/Makefile)
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Makefile.parallel?p2=cfe/trunk/test/Makefile.parallel&p1=cfe/trunk/test/Makefile&r1=48341&r2=48391&rev=48391&view=diff
==============================================================================
--- cfe/trunk/test/Makefile (original)
+++ cfe/trunk/test/Makefile.parallel Sat Mar 15 02:26:41 2008
@@ -1,14 +1,49 @@
LEVEL = ../../..
include $(LEVEL)/Makefile.common
-TESTDIRS := CodeGen Lexer Preprocessor Parser Sema Analysis Serialization
+AWK = awk
+
+TESTDIRS = CodeGen Lexer Preprocessor Parser Sema Analysis Serialization
# Only run rewriter tests on darwin.
ifeq ($(OS),Darwin)
TESTDIRS += Rewriter
endif
-all::
- PATH=$$PATH:$(ToolDir):$(LLVM_SRC_ROOT)/test/Scripts \
- find $(TESTDIRS) \( -name '*.c' -or -name '*.cpp' -or -name '*.m' \) \
- -print -exec ./TestRunner.sh {} \;
+
+Makefile.tests:
+ @ echo '%.testresults: %' > $@
+ @ echo "^@ echo $$<" | tr "^" "\t" >> $@
+ @ echo "^@ PATH=$$PATH:$(ToolDir):$(LLVM_SRC_ROOT)/test/Scripts ./TestRunner.sh &< > &@" | tr "^&" '\t$$' >> $@
+ @ echo >> $@
+ @ echo "TESTS =" \\ >> $@
+ @ find $(TESTDIRS) \
+ \( -name '*.c' -or -name '*.cpp' -or -name '*.m' \) \
+ | $(AWK) '{print " " $$0 ".testresults \\"}' >> $@
+ @ echo ' ' >> $@
+ @ echo >> $@
+ @ echo "all:: &(TESTS)" | tr "&" '$$' >> $@
+ @ echo >> $@
+ @ echo "report: &(TESTS)" | tr "&" '$$' >> $@
+ @ echo "^@ cat $$<" | tr "^&<" "\t$$^" >> $@
+ @ echo >> $@
+ @ echo "clean:" | tr "&" '$$' >> $@
+ @ echo "^@ rm -f &(TESTS)" | tr "^&<" "\t$$^" >> $@
+ @ echo >> $@
+ @ echo ".PHONY: all report clean" >> $@
+
+
+# find $(TESTDIRS) \
+# \( -name '*.c' -or -name '*.cpp' -or -name '*.m' \) \
+# | $(AWK) '{print ".PHONY:", $$0 ".testresults"}' >> $@
+
+all:: Makefile.tests
+ @ $(MAKE) -f $< clean
+ @ $(MAKE) -f $< all report
+ @ $(MAKE) -f $< clean
+ @ rm $<
+
+.PHONY: all
+
+.NOTPARALLEL:
+
More information about the cfe-commits
mailing list