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

Daniel Dunbar daniel at zuster.org
Thu Apr 8 19:15:10 PDT 2010


Author: ddunbar
Date: Thu Apr  8 21:15:10 2010
New Revision: 100846

URL: http://llvm.org/viewvc/llvm-project?rev=100846&view=rev
Log:
lit: Add support to OneCommandPerFileTest format to take input directory from input path.

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=100846&r1=100845&r2=100846&view=diff
==============================================================================
--- llvm/trunk/utils/lit/lit/TestFormats.py (original)
+++ llvm/trunk/utils/lit/lit/TestFormats.py Thu Apr  8 21:15:10 2010
@@ -129,14 +129,20 @@
             self.command = [command]
         else:
             self.command = list(command)
-        self.dir = str(dir)
+        if dir is not None:
+            dir = str(dir)
+        self.dir = dir
         self.recursive = bool(recursive)
         self.pattern = re.compile(pattern)
         self.useTempInput = useTempInput
 
     def getTestsInDirectory(self, testSuite, path_in_suite,
                             litConfig, localConfig):
-        for dirname,subdirs,filenames in os.walk(self.dir):
+        dir = self.dir
+        if dir is None:
+            dir = testSuite.getSourcePath(path_in_suite)
+
+        for dirname,subdirs,filenames in os.walk(dir):
             if not self.recursive:
                 subdirs[:] = []
 
@@ -151,7 +157,7 @@
                     continue
 
                 path = os.path.join(dirname,filename)
-                suffix = path[len(self.dir):]
+                suffix = path[len(dir):]
                 if suffix.startswith(os.sep):
                     suffix = suffix[1:]
                 test = Test.Test(testSuite,





More information about the llvm-commits mailing list