mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-06 06:33:24 +00:00
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
This commit is contained in:
parent
d96eae8010
commit
2381379d1d
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user