From 885db546711d269e5bdbcb7ba27dbf44712508d8 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. llvm-svn: 70103 --- clang/utils/test/MultiTestRunner.py | 39 ++++++++++++++--------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/clang/utils/test/MultiTestRunner.py b/clang/utils/test/MultiTestRunner.py index 0e007e0d7d4d..57650f9e275f 100755 --- a/clang/utils/test/MultiTestRunner.py +++ b/clang/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: + # 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()