Skip to content

Commit

Permalink
Fixed bug when tests in executable partially used absolute paths.
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182715 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
gkistanova committed May 26, 2013
1 parent 03abfc7 commit f0c74bd
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions utils/lit/lit/TestFormats.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ def getTestsInExecutable(self, testSuite, path_in_suite, execpath,
(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)
yield Test.Test(testSuite, testPath, localConfig)
testPath_in_suite = path_in_suite + (basename, testname)
yield Test.Test(testSuite, testPath_in_suite, localConfig)

def getTestsInDirectory(self, testSuite, path_in_suite,
litConfig, localConfig):
source_path = testSuite.getSourcePath(path_in_suite)
Expand All @@ -73,15 +73,17 @@ def getTestsInDirectory(self, testSuite, path_in_suite,
# Iterate over executables in a directory.
if not os.path.normcase(filename) in self.test_sub_dir:
continue
filepath_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, filepath_in_suite, execpath,
litConfig, localConfig):
yield test
elif ('.' in self.test_sub_dir):
filepath_in_suite = path_in_suite + (filename, )
for test in self.getTestsInExecutable(
testSuite, path_in_suite, filepath,
testSuite, filepath_in_suite, filepath,
litConfig, localConfig):
yield test

Expand Down

0 comments on commit f0c74bd

Please sign in to comment.