Mercurial > hg
changeset 21355:d83f4e94512a
run-tests: move outputtimes() into TestRunner
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sat, 19 Apr 2014 23:47:59 -0700 |
parents | 29629ef43d39 |
children | f96d7dfd8cb5 |
files | tests/run-tests.py |
diffstat | 1 files changed, 9 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/run-tests.py Sat Apr 19 23:44:56 2014 -0700 +++ b/tests/run-tests.py Sat Apr 19 23:47:59 2014 -0700 @@ -386,14 +386,6 @@ return killmod.killdaemons(pidfile, tryhard=False, remove=True, logfn=vlog) -def outputtimes(options): - vlog('# Producing time report') - times.sort(key=lambda t: (t[1], t[0]), reverse=True) - cols = '%7.3f %s' - print '\n%-7s %s' % ('Time', 'Test') - for test, timetaken in times: - print cols % (timetaken, test) - def outputcoverage(runner): vlog('# Producing coverage report') @@ -1126,7 +1118,7 @@ if results['!']: print 'python hash seed:', os.environ['PYTHONHASHSEED'] if runner.options.time: - outputtimes(runner.options) + runner.outputtimes() if runner.options.anycoverage: outputcoverage(runner) @@ -1301,6 +1293,14 @@ ' (expected %s)\n' % (verb, actualhg, expecthg)) + def outputtimes(self): + vlog('# Producing time report') + times.sort(key=lambda t: (t[1], t[0]), reverse=True) + cols = '%7.3f %s' + print '\n%-7s %s' % ('Time', 'Test') + for test, timetaken in times: + print cols % (timetaken, test) + def main(args, parser=None): runner = TestRunner()