MultiTestRunner.py improvements.
 - Tweak output directories for temp files, derive the temporary base from the
   test's parent directory name, and the test name (instead of the whole path).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77059 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/utils/test/TestRunner.py b/utils/test/TestRunner.py
index d82ddac..c767103 100755
--- a/utils/test/TestRunner.py
+++ b/utils/test/TestRunner.py
@@ -16,7 +16,6 @@
 #
 
 import errno
-import hashlib
 import os
 import platform
 import re
@@ -286,6 +285,16 @@
         
     return clangcc
     
+def getTestOutputBase(dir, testpath):
+    """getTestOutputPath(dir, testpath) - Get the full path for temporary files
+    corresponding to the given test path."""
+
+    # Form the output base out of the test parent directory name and the test
+    # name. FIXME: Find a better way to organize test results.
+    return os.path.join(dir, 
+                        os.path.basename(os.path.dirname(testpath)),
+                        os.path.basename(testpath))
+                      
 def main():
     global options
     from optparse import OptionParser
@@ -314,9 +323,7 @@
 
     for path in args:
         command = path
-        # Use hand concatentation here because we want to override
-        # absolute paths.
-        output = 'Output/' + path + '.out'
+        output = getTestOutputPath('Output', path) + '.out'
         testname = path
         
         res = runOneTest(path, command, output, testname,