From 259a565e3c89435863d9f2fdf47f49805793f4d0 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Sun, 26 Apr 2009 01:28:51 +0000 Subject: [PATCH] Make this code a little more generic. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70103 91177308-0d34-0410-b5e6-96231b3b80d8 --- utils/test/MultiTestRunner.py | 39 +++++++++++++++++------------------ 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/utils/test/MultiTestRunner.py b/utils/test/MultiTestRunner.py index 0e007e0d7d..57650f9e27 100755 --- a/utils/test/MultiTestRunner.py +++ b/utils/test/MultiTestRunner.py @@ -254,6 +254,7 @@ def main(): 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 @@ def main(): 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: - print '*'*20 - print 'Expected Failures (%d):' % len(xfails) - for tr in xfails: - print '\t%s'%(tr.path,) - - xpasses = [i for i in provider.results if i and i.code==TestStatus.XPass] - if xpasses: + # 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 'Unexpected Passing Tests (%d):' % len(xpasses) - for tr in xpasses: + print '%s (%d):' % (title, len(elts)) + for tr in elts: 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() -- 2.40.0