From: Daniel Dunbar Date: Wed, 21 Aug 2013 22:26:34 +0000 (+0000) Subject: [lit] Simplify --time-tests code. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=0dd41a99e31d098165571911fbb7d9d9a453595f;p=oota-llvm.git [lit] Simplify --time-tests code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188946 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/utils/lit/lit/main.py b/utils/lit/lit/main.py index fb3614a9e56..8f71685b5e2 100755 --- a/utils/lit/lit/main.py +++ b/utils/lit/lit/main.py @@ -407,17 +407,11 @@ def main(builtinParameters = {}): print(' %s' % t.getFullName()) sys.stdout.write('\n') - if opts.timeTests: - # Collate, in case we repeated tests. - times = {} - for t in tests: - key = t.getFullName() - times[key] = times.get(key, 0.) + t.elapsed - - byTime = list(times.items()) - byTime.sort(key = lambda item: item[1]) - if byTime: - lit.util.printHistogram(byTime, title='Tests') + if opts.timeTests and tests: + # Order by time. + test_times = [(t.getFullName(), t.elapsed) + for t in tests] + lit.util.printHistogram(test_times, title='Tests') for name,code in (('Expected Passes ', lit.Test.PASS), ('Expected Failures ', lit.Test.XFAIL),