[cfe-commits] r77059 - in /cfe/trunk/utils/test: MultiTestRunner.py TestRunner.py

Daniel Dunbar daniel at zuster.org
Sat Jul 25 02:54:08 PDT 2009


Author: ddunbar
Date: Sat Jul 25 04:53:43 2009
New Revision: 77059

URL: http://llvm.org/viewvc/llvm-project?rev=77059&view=rev
Log:
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).

Modified:
    cfe/trunk/utils/test/MultiTestRunner.py
    cfe/trunk/utils/test/TestRunner.py

Modified: cfe/trunk/utils/test/MultiTestRunner.py
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/test/MultiTestRunner.py?rev=77059&r1=77058&r2=77059&view=diff

==============================================================================
--- cfe/trunk/utils/test/MultiTestRunner.py (original)
+++ cfe/trunk/utils/test/MultiTestRunner.py Sat Jul 25 04:53:43 2009
@@ -155,11 +155,10 @@
 
     def runTest(self, (path,index)):
         command = path
-        # Use hand concatentation here because we want to override
-        # absolute paths.
-        output = 'Output/' + path + '.out'
+        base = TestRunner.getTestOutputBase('Output', path)
+        output = base + '.out'
         testname = path
-        testresults = 'Output/' + path + '.testresults'
+        testresults = base + '.testresults'
         TestRunner.mkdir_p(os.path.dirname(testresults))
         numTests = len(self.provider.tests)
         digits = len(str(numTests))

Modified: cfe/trunk/utils/test/TestRunner.py
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/test/TestRunner.py?rev=77059&r1=77058&r2=77059&view=diff

==============================================================================
--- cfe/trunk/utils/test/TestRunner.py (original)
+++ cfe/trunk/utils/test/TestRunner.py Sat Jul 25 04:53:43 2009
@@ -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, 





More information about the cfe-commits mailing list