[llvm-commits] [llvm] r86448 - /llvm/trunk/utils/lit/lit.py
Daniel Dunbar
daniel at zuster.org
Sun Nov 8 01:07:27 PST 2009
Author: ddunbar
Date: Sun Nov 8 03:07:26 2009
New Revision: 86448
URL: http://llvm.org/viewvc/llvm-project?rev=86448&view=rev
Log:
lit: Warn when a test suite contains no tests.
Modified:
llvm/trunk/utils/lit/lit.py
Modified: llvm/trunk/utils/lit/lit.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/lit.py?rev=86448&r1=86447&r2=86448&view=diff
==============================================================================
--- llvm/trunk/utils/lit/lit.py (original)
+++ llvm/trunk/utils/lit/lit.py Sun Nov 8 03:07:26 2009
@@ -236,8 +236,8 @@
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 @@
# 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 @@
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)
More information about the llvm-commits
mailing list