changeset 19300:d7d40600a248

run-tests: report interrupted tests When the test run is aborted, a message is printed for each interrupted test. This is helpful when a test is hanging. example failure message: INTERRUPTED: /path/to/tests/test-example.t The message can appear before or after the line with the number of tests
author Simon Heimberg <simohe@besonet.ch>
date Wed, 05 Jun 2013 22:05:02 +0200
parents cdc612db2ffb
children f2dd00f1f6fb
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:42:43 2013 +0200
+++ b/tests/run-tests.py	Wed Jun 05 22:05:02 2013 +0200
@@ -962,7 +962,11 @@
 
     if options.time:
         starttime = time.time()
-    ret, out = runner(testpath, testtmp, options, replacements, env)
+    try:
+        ret, out = runner(testpath, testtmp, options, replacements, env)
+    except KeyboardInterrupt:
+        log('INTERRUPTED:', test)
+        raise
     if options.time:
         endtime = time.time()
         times.append((test, endtime - starttime))