From 716176fa997c554e424485897894ec2898f8254f Mon Sep 17 00:00:00 2001 From: Timothy J Fontaine Date: Tue, 7 May 2013 11:59:22 -0700 Subject: [PATCH] test: report test duration in TAP progress --- tools/test.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tools/test.py b/tools/test.py index 90c79bc..7d5ddc6 100755 --- a/tools/test.py +++ b/tools/test.py @@ -39,6 +39,7 @@ import subprocess import sys import tempfile import time +import datetime import threading from Queue import Queue, Empty @@ -115,9 +116,9 @@ class ProgressIndicator(object): self.AboutToRun(case) self.lock.release() try: - start = time.time() + start = datetime.datetime.now() output = case.Run() - case.duration = (time.time() - start) + case.duration = (datetime.datetime.now() - start) except IOError, e: assert self.terminate return @@ -242,6 +243,12 @@ class TapProgressIndicator(SimpleProgressIndicator): else: print 'ok %i - %s' % (self._done, command) + duration = output.test.duration + + print ' ---' + print ' duration_ms: %d.%d' % (duration.total_seconds(), duration.microseconds / 1000) + print ' ...' + def Done(self): pass -- 2.7.4