Browse Source

test: report test duration in TAP progress

v0.11.2-release
Timothy J Fontaine 12 years ago
parent
commit
ee4f0baeac
  1. 11
      tools/test.py

11
tools/test.py

@ -39,6 +39,7 @@ import subprocess
import sys import sys
import tempfile import tempfile
import time import time
import datetime
import threading import threading
from Queue import Queue, Empty from Queue import Queue, Empty
import utils import utils
@ -113,9 +114,9 @@ class ProgressIndicator(object):
self.AboutToRun(case) self.AboutToRun(case)
self.lock.release() self.lock.release()
try: try:
start = time.time() start = datetime.datetime.now()
output = case.Run() output = case.Run()
case.duration = (time.time() - start) case.duration = (datetime.datetime.now() - start)
except IOError, e: except IOError, e:
assert self.terminate assert self.terminate
return return
@ -240,6 +241,12 @@ class TapProgressIndicator(SimpleProgressIndicator):
else: else:
print 'ok %i - %s' % (self._done, command) 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): def Done(self):
pass pass

Loading…
Cancel
Save