diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-09-15 20:09:17 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-09-15 20:09:17 +0000 |
commit | 91304e2755539fa6e746731028f25083ab09722f (patch) | |
tree | 2199fc17253f8aa1869f56b4636dd5f08e840ca6 /utils/lit | |
parent | 2494777a2cb2e6e78713b12c0658523856b44ecb (diff) | |
download | external_llvm-91304e2755539fa6e746731028f25083ab09722f.zip external_llvm-91304e2755539fa6e746731028f25083ab09722f.tar.gz external_llvm-91304e2755539fa6e746731028f25083ab09722f.tar.bz2 |
lit: When finding nested test suites, check first in the execpath in case there
is a site configuration.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81902 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/lit')
-rwxr-xr-x | utils/lit/lit.py | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/utils/lit/lit.py b/utils/lit/lit.py index bc43c50..f9e75cd 100755 --- a/utils/lit/lit.py +++ b/utils/lit/lit.py @@ -264,19 +264,28 @@ def getTestsInSuite(ts, path_in_suite, litConfig, if filename == 'Output' or filename in lc.excludes: continue - filepath = os.path.join(source_path, filename) - if os.path.isdir(filepath): - # If this directory contains a test suite, reload it. - if dirContainsTestSuite(filepath): - for res in getTests(filepath, litConfig, - testSuiteCache, localConfigCache): - yield res - else: - # Otherwise, continue loading from inside this test suite. - for res in getTestsInSuite(ts, path_in_suite + (filename,), - litConfig, testSuiteCache, - localConfigCache): - yield res + # Ignore non-directories. + file_sourcepath = os.path.join(source_path, filename) + if not os.path.isdir(file_sourcepath): + continue + + # Check for nested test suites, first in the execpath in case there is a + # site configuration and then in the source path. + file_execpath = ts.getExecPath(path_in_suite + (filename,)) + if dirContainsTestSuite(file_execpath): + subiter = getTests(file_execpath, litConfig, + testSuiteCache, localConfigCache) + elif dirContainsTestSuite(file_sourcepath): + subiter = getTests(file_sourcepath, litConfig, + testSuiteCache, localConfigCache) + else: + # Otherwise, continue loading from inside this test suite. + subiter = getTestsInSuite(ts, path_in_suite + (filename,), + litConfig, testSuiteCache, + localConfigCache) + + for res in subiter: + yield res def runTests(numThreads, litConfig, provider, display): # If only using one testing thread, don't use threads at all; this lets us |