changeset 19301:f2dd00f1f6fb

run-tests: when interrupted report time in failure message When --time is specified, the interruption message of an interrupted test is extended with the time the test has run INTERRUPTED: /path/to/tests/test-example.t (after 513 seconds)
author Simon Heimberg <simohe@besonet.ch>
date Wed, 05 Jun 2013 22:05:29 +0200
parents d7d40600a248
children a1b8b1b9e2e2
files tests/run-tests.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/tests/run-tests.py	Wed Jun 05 22:05:02 2013 +0200
+++ b/tests/run-tests.py	Wed Jun 05 22:05:29 2013 +0200
@@ -965,7 +965,11 @@
     try:
         ret, out = runner(testpath, testtmp, options, replacements, env)
     except KeyboardInterrupt:
-        log('INTERRUPTED:', test)
+        msg = ''
+        if options.time:
+            endtime = time.time()
+            msg = '(after %d seconds)' % (endtime - starttime)
+        log('INTERRUPTED:', test, msg)
         raise
     if options.time:
         endtime = time.time()