[llvm] r182910 - Fixed bug when tests in executable partially used absolute paths.

Galina Kistanova gkistanova at gmail.com
Wed May 29 21:56:29 PDT 2013


Author: gkistanova
Date: Wed May 29 23:56:28 2013
New Revision: 182910

URL: http://llvm.org/viewvc/llvm-project?rev=182910&view=rev
Log:
Fixed bug when tests in executable partially used absolute paths.

Modified:
    llvm/trunk/utils/lit/lit/TestFormats.py

Modified: llvm/trunk/utils/lit/lit/TestFormats.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/lit/TestFormats.py?rev=182910&r1=182909&r2=182910&view=diff
==============================================================================
--- llvm/trunk/utils/lit/lit/TestFormats.py (original)
+++ llvm/trunk/utils/lit/lit/TestFormats.py Wed May 29 23:56:28 2013
@@ -54,6 +54,7 @@ class GoogleTest(object):
             else:
                 yield ''.join(nested_tests) + ln
 
+    # Note: path_in_suite should not include the executable name.
     def getTestsInExecutable(self, testSuite, path_in_suite, execpath,
                              litConfig, localConfig):
         if not execpath.endswith(self.test_suffix):
@@ -61,9 +62,9 @@ class GoogleTest(object):
         (dirname, basename) = os.path.split(execpath)
         # Discover the tests in this executable.
         for testname in self.getGTestTests(execpath, litConfig, localConfig):
-            testPath = path_in_suite + (dirname, basename, testname)
+            testPath = path_in_suite + (basename, testname)
             yield Test.Test(testSuite, testPath, localConfig)
-    
+
     def getTestsInDirectory(self, testSuite, path_in_suite,
                             litConfig, localConfig):
         source_path = testSuite.getSourcePath(path_in_suite)
@@ -73,10 +74,11 @@ class GoogleTest(object):
                 # Iterate over executables in a directory.
                 if not os.path.normcase(filename) in self.test_sub_dir:
                     continue
+                dirpath_in_suite = path_in_suite + (filename, )
                 for subfilename in os.listdir(filepath):
                     execpath = os.path.join(filepath, subfilename)
                     for test in self.getTestsInExecutable(
-                            testSuite, path_in_suite, execpath,
+                            testSuite, dirpath_in_suite, execpath,
                             litConfig, localConfig):
                       yield test
             elif ('.' in self.test_sub_dir):





More information about the llvm-commits mailing list