Patchwork [1,of,2] run-tests: report interrupted tests

login
register
mail settings
Submitter Simon Heimberg
Date June 5, 2013, 9:14 p.m.
Message ID <227d4459ac24fc8a5083.1370466876@lapsi.heimberg.home>
Download mbox | patch
Permalink /patch/1704/
State Accepted
Commit d7d40600a248da05a9598d92b764a916a0687750
Headers show

Comments

Simon Heimberg - June 5, 2013, 9:14 p.m.
# HG changeset patch
# User Simon Heimberg <simohe@besonet.ch>
# Date 1370462702 -7200
# Node ID 227d4459ac24fc8a5083bf62a182c78f756e3bd7
# Parent  db081600a8eecfe66a907a3164020226c2a81a1a
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

Patch

diff -r db081600a8ee -r 227d4459ac24 tests/run-tests.py
--- a/tests/run-tests.py	Mit Jun 05 21:16:49 2013 +0200
+++ b/tests/run-tests.py	Mit 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:', testpath)
+        raise
     if options.time:
         endtime = time.time()
         times.append((test, endtime - starttime))