diff options
author | Timothy J Fontaine <tjfontaine@gmail.com> | 2013-05-07 15:17:33 -0700 |
---|---|---|
committer | Timothy J Fontaine <tjfontaine@gmail.com> | 2013-05-07 15:40:04 -0700 |
commit | cf87ee67eed4409bdd14a4d75b5d7053328cce91 (patch) | |
tree | 4b71041bb85de0776cbd3fa39ae95dc6bd908a8f /tools | |
parent | 716176fa997c554e424485897894ec2898f8254f (diff) | |
download | android-node-v8-cf87ee67eed4409bdd14a4d75b5d7053328cce91.tar.gz android-node-v8-cf87ee67eed4409bdd14a4d75b5d7053328cce91.tar.bz2 android-node-v8-cf87ee67eed4409bdd14a4d75b5d7053328cce91.zip |
test: don't use total_seconds() because of py2.6
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/test.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/tools/test.py b/tools/test.py index 7d5ddc69da..c922c40f7e 100755 --- a/tools/test.py +++ b/tools/test.py @@ -31,7 +31,6 @@ import imp import optparse import os -from os.path import join, dirname, abspath, basename, isdir, exists import platform import re import signal @@ -39,8 +38,10 @@ import subprocess import sys import tempfile import time -import datetime import threading + +from os.path import join, dirname, abspath, basename, isdir, exists +from datetime import datetime from Queue import Queue, Empty sys.path.append(dirname(__file__) + "/../deps/v8/tools"); @@ -116,9 +117,9 @@ class ProgressIndicator(object): self.AboutToRun(case) self.lock.release() try: - start = datetime.datetime.now() + start = datetime.now() output = case.Run() - case.duration = (datetime.datetime.now() - start) + case.duration = (datetime.now() - start) except IOError, e: assert self.terminate return @@ -245,8 +246,12 @@ class TapProgressIndicator(SimpleProgressIndicator): duration = output.test.duration + # total_seconds() was added in 2.7 + total_seconds = (duration.microseconds + + (duration.seconds + duration.days * 24 * 3600) * 10**6) / 10**6 + print ' ---' - print ' duration_ms: %d.%d' % (duration.total_seconds(), duration.microseconds / 1000) + print ' duration_ms: %d.%d' % (total_seconds, duration.microseconds / 1000) print ' ...' def Done(self): |