From: Daniel Dunbar Date: Sat, 25 Jul 2009 09:53:43 +0000 (+0000) Subject: MultiTestRunner.py improvements. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=df0848982ffa87a2f7c1c8a7454489c95d8b6251;p=clang 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/MultiTestRunner.py b/utils/test/MultiTestRunner.py index c43789dad3..41cf537143 100755 --- a/utils/test/MultiTestRunner.py +++ b/utils/test/MultiTestRunner.py @@ -155,11 +155,10 @@ class Tester(threading.Thread): 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)) diff --git a/utils/test/TestRunner.py b/utils/test/TestRunner.py index d82ddac2d8..c767103377 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 @@ def inferClangCC(clang): 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 @@ def main(): 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,