aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-04-09 02:15:10 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-04-09 02:15:10 +0000
commit2381379d1d2a3a4ac447e82906bc989369865ad4 (patch)
tree06e81fe133507c86678c1c89057e3d4735f9a5e2
parentd96eae80107a0881e21d1dda97e5e848ed055ec2 (diff)
downloadexternal_llvm-2381379d1d2a3a4ac447e82906bc989369865ad4.zip
external_llvm-2381379d1d2a3a4ac447e82906bc989369865ad4.tar.gz
external_llvm-2381379d1d2a3a4ac447e82906bc989369865ad4.tar.bz2
lit: Add support to OneCommandPerFileTest format to take input directory from input path.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100846 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--utils/lit/lit/TestFormats.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/utils/lit/lit/TestFormats.py b/utils/lit/lit/TestFormats.py
index 7ab9bb6..5e1a811 100644
--- a/utils/lit/lit/TestFormats.py
+++ b/utils/lit/lit/TestFormats.py
@@ -129,14 +129,20 @@ class OneCommandPerFileTest:
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 @@ class OneCommandPerFileTest:
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,