aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabor Greif <ggreif@gmail.com>2008-03-15 07:26:41 +0000
committerGabor Greif <ggreif@gmail.com>2008-03-15 07:26:41 +0000
commit021e970d77b52372863b1c96503ecf8cfc6312df (patch)
treee5a248b2873d42d02ae3b3693ea1d133bcd4518d
parent6c2b6eb8d836da19007f7540709e16d5e39a1cba (diff)
First draft of a parallelized test methodology. Improvements soon.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48391 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/Makefile.parallel49
1 files changed, 49 insertions, 0 deletions
diff --git a/test/Makefile.parallel b/test/Makefile.parallel
new file mode 100644
index 0000000000..35bea3a5a0
--- /dev/null
+++ b/test/Makefile.parallel
@@ -0,0 +1,49 @@
+LEVEL = ../../..
+include $(LEVEL)/Makefile.common
+
+AWK = awk
+
+TESTDIRS = CodeGen Lexer Preprocessor Parser Sema Analysis Serialization
+
+# Only run rewriter tests on darwin.
+ifeq ($(OS),Darwin)
+TESTDIRS += Rewriter
+endif
+
+
+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:
+