[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r40229 - trunk/build

From: Blair Zajac <blair_at_orcaware.com>
Date: Mon, 26 Oct 2009 20:52:06 -0700

On Oct 26, 2009, at 8:38 PM, Bhuvaneswaran A wrote:

> Author: bhuvan
> Date: Mon Oct 26 20:38:19 2009
> New Revision: 40229
>
> Log:
> While running the test suite, even the microseconds are accountable.
>
> * build/run_tests.py
> import datetime
> (_run_test): Include microseconds while printing the time taken to
> execute each test. Use datetime library instead of time library.
>
> Reviewed by: brane
>
> Modified:
> trunk/build/run_tests.py
>
> Modified: trunk/build/run_tests.py
>
> import getopt
> try:
> @@ -206,7 +206,7 @@ class TestHarness:
> log.write('START: %s\n' % progbase)
> log.flush()
>
> - start_time = time.time()
> + start_time = datetime.now()
> if progbase[-3:] == '.py':
> progname = sys.executable
> cmdline = [quote(progname),
> @@ -270,8 +270,7 @@ class TestHarness:
> log.write('FAIL: %s: Unknown test failure.\n' % progbase)
>
> # Log the elapsed time.
> - elapsed_time = time.strftime('%H:%M:%S',
> - time.gmtime(time.time() - start_time))
> + elapsed_time = str(datetime.now() - start_time)

You don't need to put the value in str() since you're going to pass it
to the % operator below for a %s interpolation, which calls str() on
it already.

Regards,
Blair

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2411584
Received on 2009-10-27 04:52:20 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.