Skip to content

Commit

Permalink
[lit] Simplify --time-tests code.
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188946 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
ddunbar committed Aug 21, 2013
1 parent 7b0cdf7 commit 0dd41a9
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions utils/lit/lit/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,17 +407,11 @@ def console_ctrl_handler(type):
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),
Expand Down

0 comments on commit 0dd41a9

Please sign in to comment.