]> granicus.if.org Git - clang/commitdiff
First draft of a parallelized test methodology. Improvements soon.
authorGabor Greif <ggreif@gmail.com>
Sat, 15 Mar 2008 07:26:41 +0000 (07:26 +0000)
committerGabor Greif <ggreif@gmail.com>
Sat, 15 Mar 2008 07:26:41 +0000 (07:26 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48391 91177308-0d34-0410-b5e6-96231b3b80d8

test/Makefile.parallel [new file with mode: 0644]

diff --git a/test/Makefile.parallel b/test/Makefile.parallel
new file mode 100644 (file)
index 0000000..35bea3a
--- /dev/null
@@ -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:
+