[cfe-commits] r70103 - /cfe/trunk/utils/test/MultiTestRunner.py
Daniel Dunbar
daniel at zuster.org
Sat Apr 25 18:28:52 PDT 2009
Author: ddunbar
Date: Sat Apr 25 20:28:51 2009
New Revision: 70103
URL: http://llvm.org/viewvc/llvm-project?rev=70103&view=rev
Log:
Make this code a little more generic.
Modified:
cfe/trunk/utils/test/MultiTestRunner.py
Modified: cfe/trunk/utils/test/MultiTestRunner.py
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/test/MultiTestRunner.py?rev=70103&r1=70102&r2=70103&view=diff
==============================================================================
--- cfe/trunk/utils/test/MultiTestRunner.py (original)
+++ cfe/trunk/utils/test/MultiTestRunner.py Sat Apr 25 20:28:51 2009
@@ -254,6 +254,7 @@
if not args:
parser.error('No inputs specified')
+ # FIXME: It could be worth loading these in parallel with testing.
allTests = list(getTests(args))
allTests.sort()
@@ -304,29 +305,27 @@
if not opts.quiet:
print 'Testing Time: %.2fs'%(time.time() - startTime)
- xfails = [i for i in provider.results if i and i.code==TestStatus.XFail]
- if xfails:
+ # List test results organized organized by kind.
+ byCode = {}
+ for t in provider.results:
+ if t:
+ if t.code not in byCode:
+ byCode[t.code] = []
+ byCode[t.code].append(t)
+ for title,code in (('Expected Failures', TestStatus.XFail),
+ ('Unexpected Passing Tests', TestStatus.XPass),
+ ('Failing Tests', TestStatus.Fail)):
+ elts = byCode.get(code)
+ if not elts:
+ continue
print '*'*20
- print 'Expected Failures (%d):' % len(xfails)
- for tr in xfails:
+ print '%s (%d):' % (title, len(elts))
+ for tr in elts:
print '\t%s'%(tr.path,)
- xpasses = [i for i in provider.results if i and i.code==TestStatus.XPass]
- if xpasses:
- print '*'*20
- print 'Unexpected Passing Tests (%d):' % len(xpasses)
- for tr in xpasses:
- print '\t%s'%(tr.path,)
-
- failures = [i for i in provider.results if i and i.code==TestStatus.Fail]
- if failures:
- print '*'*20
- print 'Failing Tests (%d):' % len(failures)
- for tr in failures:
- if tr.code != TestStatus.XPass:
- print '\t%s'%(tr.path,)
-
- print '\nFailures: %d'%(len(failures),)
+ numFailures = len(byCode.get(TestStatus.Fail,[]))
+ if numFailures:
+ print '\nFailures: %d' % (numFailures,)
if __name__=='__main__':
main()
More information about the cfe-commits
mailing list