From 596ae38451e269e40e3b30ab6f6f016bd9076c04 Mon Sep 17 00:00:00 2001 From: Stefano Lattarini Date: Sat, 6 Aug 2011 20:48:09 +0200 Subject: [PATCH] tap driver: a preparatory refactoring (1) * lib/tap-driver (finish): Do not flush the TAP stream nor fetch the exit status of the TAP producer if running with the `--ignore-exit' option. Obviously, don't try to write such exit status in the test log anymore. --- ChangeLog | 8 ++++++++ lib/tap-driver | 21 ++++++++------------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 76ca19fd4..033daec62 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2011-08-06 Stefano Lattarini + + tap driver: a preparatory refactoring (1) + * lib/tap-driver (finish): Do not flush the TAP stream nor + fetch the exit status of the TAP producer if running with + the `--ignore-exit' option. Obviously, don't try to write + such exit status in the test log anymore. + 2011-08-06 Stefano Lattarini cosmetics: typofix in the name of a function in the TAP driver diff --git a/lib/tap-driver b/lib/tap-driver index 508f5b317..a8743202f 100755 --- a/lib/tap-driver +++ b/lib/tap-driver @@ -232,21 +232,16 @@ sub start (@) sub finish () { - # Flush all the remaining TAP stream, so that we can obtain the - # exit status of the TAP producer. - do {} while defined get_tap_line (); - # TODO: we should probably use $parser->wait here, to catch signals too - if ($parser->exit != 0) + if (!$cfg{"ignore-exit"}) { - my $msg = sprintf "exited with status %d", $parser->exit; - if ($cfg{"ignore-exit"}) - { - # Log the exit status of the script anyway, even if it is not - # considered to be an error, to help debugging. - print "INFO: $test_script_name - $msg\n"; - } - else + # Flush all the remaining TAP stream, so that we can obtain the + # exit status of the TAP producer. + do {} while defined get_tap_line (); + # TODO: we should probably use $parser->wait here, to catch + # TODO: signals too + if ($parser->exit != 0) { + my $msg = sprintf "exited with status %d", $parser->exit; testsuite_error $msg; } } -- 2.47.2