[llvm-commits] [llvm] r114726 - /llvm/trunk/utils/lit/lit/TestFormats.py

Michael J. Spencer bigcheesegs at gmail.com
Fri Sep 24 02:01:22 PDT 2010


Author: mspencer
Date: Fri Sep 24 04:01:22 2010
New Revision: 114726

URL: http://llvm.org/viewvc/llvm-project?rev=114726&view=rev
Log:
Test unittests built with CMake.

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=114726&r1=114725&r2=114726&view=diff
==============================================================================
--- llvm/trunk/utils/lit/lit/TestFormats.py (original)
+++ llvm/trunk/utils/lit/lit/TestFormats.py Fri Sep 24 04:01:22 2010
@@ -9,7 +9,7 @@
 
 class GoogleTest(object):
     def __init__(self, test_sub_dir, test_suffix):
-        self.test_sub_dir = str(test_sub_dir)
+        self.test_sub_dir = str(test_sub_dir).split(';')
         self.test_suffix = str(test_suffix)
 
         # On Windows, assume tests will also end in '.exe'.
@@ -28,7 +28,10 @@
 
         try:
             lines = Util.capture([path, '--gtest_list_tests'],
-                                 env=localConfig.environment).split('\n')
+                                 env=localConfig.environment)
+            if kIsWindows:
+              lines = lines.replace('\r', '')
+            lines = lines.split('\n')
         except:
             litConfig.error("unable to discover google-tests in %r" % path)
             raise StopIteration
@@ -56,10 +59,13 @@
         source_path = testSuite.getSourcePath(path_in_suite)
         for filename in os.listdir(source_path):
             # Check for the one subdirectory (build directory) tests will be in.
-            if filename != self.test_sub_dir:
+            if not filename in self.test_sub_dir:
                 continue
 
             filepath = os.path.join(source_path, filename)
+            if not os.path.isdir(filepath):
+                continue
+
             for subfilename in os.listdir(filepath):
                 if subfilename.endswith(self.test_suffix):
                     execpath = os.path.join(filepath, subfilename)





More information about the llvm-commits mailing list