summaryrefslogtreecommitdiff
path: root/test/testrunner.pl
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2008-06-18 08:29:03 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2008-06-18 08:29:03 +0000
commit96b235849d8ea35827bc99cd8c2fc94108e4d4d5 (patch)
treeea20046c8fe9dab6bfbe3057f8aa01e85da061c4 /test/testrunner.pl
parent946f89560fe1136391e4a3dbb99e1dea579487ab (diff)
downloadlibhubbub-96b235849d8ea35827bc99cd8c2fc94108e4d4d5.tar.gz
libhubbub-96b235849d8ea35827bc99cd8c2fc94108e4d4d5.tar.bz2
Catch non-zero exit status and treat it as a failure
svn path=/trunk/hubbub/; revision=4379
Diffstat (limited to 'test/testrunner.pl')
-rw-r--r--test/testrunner.pl14
1 files changed, 13 insertions, 1 deletions
diff --git a/test/testrunner.pl b/test/testrunner.pl
index 7faca23..d7878e7 100644
--- a/test/testrunner.pl
+++ b/test/testrunner.pl
@@ -116,7 +116,7 @@ sub run_test
my $pid = open3("&<NULL", \*OUT, \*ERR, @_);
- $SIG{CHLD} = sub { waitpid($pid, 0); };
+ $SIG{CHLD} = sub { };
my $selector = IO::Select->new();
$selector->add(*OUT, *ERR);
@@ -140,6 +140,18 @@ sub run_test
}
}
+ waitpid($pid, 0);
+
+ # Catch non-zero exit status and turn it into failure
+ if ($? != 0) {
+ my $status = $? & 127;
+
+ if ($status != 0) {
+ print LOG " FAIL: Exit status $status\n";
+ }
+ $last = "FAIL";
+ }
+
print substr($last, 0, 4) . "\n";
# Bail, noisily, on failure