Implemented verbose mode.
  make test VERBOSE=1
should now produce the same output like
the Makefile normally does.
Without VERBOSE only the names of failed tests
are printed.

I am pretty comfortable with this version, and
I think it is time to switch over to Makefile.parallel
to be the default.

What do you think? Did I forget some piece of feedback?


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48458 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Makefile.parallel b/test/Makefile.parallel
index bc4209c..710fb4c 100644
--- a/test/Makefile.parallel
+++ b/test/Makefile.parallel
@@ -8,18 +8,24 @@
 TESTDIRS += Rewriter
 endif
 
+ifdef VERBOSE
+PROGRESS = echo $<
+REPORTFAIL = cat $@
+else
+PROGRESS = printf '.'
+REPORTFAIL = (echo; echo '----' $< 'failed ----')
+endif
+
 TESTS = $(addprefix Output/, $(addsuffix .testresults, $(shell find $(TESTDIRS) \( -name '*.c' -or -name '*.cpp' -or -name '*.m' \))))
 
 Output/%.testresults: %
-	@ printf '.'
-	@ PATH=$$PATH:$(ToolDir):$(LLVM_SRC_ROOT)/test/Scripts ./TestRunner.sh $< > $@ || (echo; echo '----' $< 'failed ----')
+	@ $(PROGRESS)
+	@ PATH=$$PATH:$(ToolDir):$(LLVM_SRC_ROOT)/test/Scripts ./TestRunner.sh $< > $@ || $(REPORTFAIL)
 
 all::
 	@ rm -f $(TESTS)
 	@ echo '--- Running clang tests ---'
 	@ $(MAKE) -f Makefile.parallel $(TESTS)
-	@ echo
-	@ $(MAKE) -f Makefile.parallel report
 
 report: $(TESTS)
 	@ cat $^