diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-11-08 09:07:26 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-11-08 09:07:26 +0000 |
commit | 1bf013904ff4281985b7d51d8f628c90127f7d8f (patch) | |
tree | faf235e1a6128b6a505642ce34832818798603fc /utils | |
parent | ee504b8cd78f5d54e4ae6ed2cfff88a9e8226771 (diff) | |
download | external_llvm-1bf013904ff4281985b7d51d8f628c90127f7d8f.zip external_llvm-1bf013904ff4281985b7d51d8f628c90127f7d8f.tar.gz external_llvm-1bf013904ff4281985b7d51d8f628c90127f7d8f.tar.bz2 |
lit: Warn when a test suite contains no tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86448 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rwxr-xr-x | utils/lit/lit.py | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/utils/lit/lit.py b/utils/lit/lit.py index 462f912..d4820d0 100755 --- a/utils/lit/lit.py +++ b/utils/lit/lit.py @@ -236,8 +236,8 @@ def getTests(path, litConfig, testSuiteCache, localConfigCache): litConfig.note('resolved input %r to %r::%r' % (path, ts.name, path_in_suite)) - return getTestsInSuite(ts, path_in_suite, litConfig, - testSuiteCache, localConfigCache) + return ts, getTestsInSuite(ts, path_in_suite, litConfig, + testSuiteCache, localConfigCache) def getTestsInSuite(ts, path_in_suite, litConfig, testSuiteCache, localConfigCache): @@ -277,19 +277,24 @@ def getTestsInSuite(ts, path_in_suite, litConfig, # 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) + sub_ts, subiter = getTests(file_execpath, litConfig, + testSuiteCache, localConfigCache) elif dirContainsTestSuite(file_sourcepath): - subiter = getTests(file_sourcepath, litConfig, - testSuiteCache, localConfigCache) + sub_ts, 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) + sub_ts = None + N = 0 for res in subiter: + N += 1 yield res + if sub_ts and not N: + litConfig.warning('test suite %r contained no tests' % sub_ts.name) def runTests(numThreads, litConfig, provider, display): # If only using one testing thread, don't use threads at all; this lets us @@ -428,7 +433,7 @@ def main(): for input in inputs: prev = len(tests) tests.extend(getTests(input, litConfig, - testSuiteCache, localConfigCache)) + testSuiteCache, localConfigCache)[1]) if prev == len(tests): litConfig.warning('input %r contained no tests' % input) |