Testing improvements:
 - Make python test runner force COLUMNS=0 to increase determinism.

 - Substitute clang-cc as we do for clang.

 - Improved detection of Ctrl-C.

 - Honor CLANG and CLANGCC environment variables.

 - Add proper command line arguments to TestRunner.py (see --help)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73640 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/utils/test/MultiTestRunner.py b/utils/test/MultiTestRunner.py
index b7ec569..6d0c14a 100755
--- a/utils/test/MultiTestRunner.py
+++ b/utils/test/MultiTestRunner.py
@@ -169,7 +169,7 @@
                 code = None
             else:
                 code = TestRunner.runOneTest(path, command, output, testname, 
-                                             opts.clang,
+                                             opts.clang, opts.clangcc,
                                              useValgrind=opts.useValgrind,
                                              useDGCompat=opts.useDGCompat,
                                              useScript=opts.testScript,
@@ -200,7 +200,7 @@
         ncpus = int(os.environ["NUMBER_OF_PROCESSORS"]);
         if ncpus > 0:
             return ncpus
-        return 1 # Default
+    return 1 # Default
 
 def main():
     global options
@@ -212,7 +212,10 @@
                       default=detectCPUs())
     parser.add_option("", "--clang", dest="clang",
                       help="Program to use as \"clang\"",
-                      action="store", default="clang")
+                      action="store", default=None)
+    parser.add_option("", "--clang-cc", dest="clangcc",
+                      help="Program to use as \"clang-cc\"",
+                      action="store", default=None)
     parser.add_option("", "--vg", dest="useValgrind",
                       help="Run tests under valgrind",
                       action="store_true", default=False)
@@ -241,7 +244,7 @@
                       help="Run tests in random order",
                       action="store_true", default=False)
     parser.add_option("", "--seed", dest="seed",
-                      help="Seed for random number generator (default: random).",
+                      help="Seed for random number generator (default: random)",
                       action="store", default=None)
     parser.add_option("", "--no-progress-bar", dest="useProgressBar",
                       help="Do not use curses based progress bar",
@@ -258,6 +261,11 @@
     if not args:
         parser.error('No inputs specified')
 
+    if opts.clang is None:
+        opts.clang = TestRunner.inferClang()
+    if opts.clangcc is None:
+        opts.clangcc = TestRunner.inferClangCC(opts.clang)
+
     # FIXME: It could be worth loading these in parallel with testing.
     allTests = list(getTests(args))
     allTests.sort()
@@ -279,7 +287,8 @@
     extra = ''
     if len(tests) != len(allTests):
         extra = ' of %d'%(len(allTests),)
-    header = '-- Testing: %d%s tests, %d threads --'%(len(tests),extra,opts.numThreads)
+    header = '-- Testing: %d%s tests, %d threads --'%(len(tests),extra,
+                                                      opts.numThreads)
 
     progressBar = None
     if not opts.quiet: