[llvm] r188946 - [lit] Simplify --time-tests code.
Daniel Dunbar
daniel at zuster.org
Wed Aug 21 15:26:35 PDT 2013
Author: ddunbar
Date: Wed Aug 21 17:26:34 2013
New Revision: 188946
URL: http://llvm.org/viewvc/llvm-project?rev=188946&view=rev
Log:
[lit] Simplify --time-tests code.
Modified:
llvm/trunk/utils/lit/lit/main.py
Modified: llvm/trunk/utils/lit/lit/main.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/lit/main.py?rev=188946&r1=188945&r2=188946&view=diff
==============================================================================
--- llvm/trunk/utils/lit/lit/main.py (original)
+++ llvm/trunk/utils/lit/lit/main.py Wed Aug 21 17:26:34 2013
@@ -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),
More information about the llvm-commits
mailing list