Patchwork [V2] run-tests: report tests as failed when run-test raises an error

login
register
mail settings
Submitter Simon Heimberg
Date Jan. 16, 2014, 6:11 p.m.
Message ID <847ba1b088c409c1bf09.1389895893@lapsi.heimberg.home>
Download mbox | patch
Permalink /patch/3352/
State Accepted
Commit 3cd441353d6ba351b5e9431048726f477e371cfc
Headers show

Comments

Simon Heimberg - Jan. 16, 2014, 6:11 p.m.
# HG changeset patch
# User Simon Heimberg <simohe@besonet.ch>
# Date 1389894935 -3600
# Node ID 847ba1b088c409c1bf093cee39acb9cfb2f5639c
# Parent  51014454e4ba19cccb978609a888410327505e13
run-tests: report tests as failed when run-test raises an error

Before no message was returned to the main thread. No result was registered
and no new thread was started.
This does not happen when running normal. But when fiddling around with
the test infrastructure, this helps a lot.
Augie Fackler - Jan. 16, 2014, 6:25 p.m.
On Thu, Jan 16, 2014 at 07:11:33PM +0100, Simon Heimberg wrote:
> # HG changeset patch
> # User Simon Heimberg <simohe@besonet.ch>
> # Date 1389894935 -3600
> # Node ID 847ba1b088c409c1bf093cee39acb9cfb2f5639c
> # Parent  51014454e4ba19cccb978609a888410327505e13
> run-tests: report tests as failed when run-test raises an error

Thanks, I'll splice this in using obsolete to replace the older version.

>
> Before no message was returned to the main thread. No result was registered
> and no new thread was started.
> This does not happen when running normal. But when fiddling around with
> the test infrastructure, this helps a lot.
>
> diff -r 51014454e4ba -r 847ba1b088c4 tests/run-tests.py
> --- a/tests/run-tests.py	Don Jan 16 11:26:54 2014 +0100
> +++ b/tests/run-tests.py	Don Jan 16 18:55:35 2014 +0100
> @@ -1092,6 +1092,9 @@
>              done.put(runone(options, test, count))
>          except KeyboardInterrupt:
>              pass
> +        except: # re-raises
> +            done.put(('!', test, 'run-test raised an error, see traceback'))
> +            raise
>
>      try:
>          while tests or running:

Patch

diff -r 51014454e4ba -r 847ba1b088c4 tests/run-tests.py
--- a/tests/run-tests.py	Don Jan 16 11:26:54 2014 +0100
+++ b/tests/run-tests.py	Don Jan 16 18:55:35 2014 +0100
@@ -1092,6 +1092,9 @@ 
             done.put(runone(options, test, count))
         except KeyboardInterrupt:
             pass
+        except: # re-raises
+            done.put(('!', test, 'run-test raised an error, see traceback'))
+            raise
 
     try:
         while tests or running: