From 021e970d77b52372863b1c96503ecf8cfc6312df Mon Sep 17 00:00:00 2001 From: Gabor Greif Date: Sat, 15 Mar 2008 07:26:41 +0000 Subject: [PATCH] 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 --- test/Makefile.parallel | 49 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 test/Makefile.parallel 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: + -- 2.40.0