summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2008-03-05 15:25:29 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2008-03-05 15:25:29 +0000
commita912773ba580048b6164dfc112337a5f89e58b9b (patch)
tree600f8be2c36a205373b1b88f3e354c8b2798ff82
parent5c477deb0ad3e05dfac2336c311f6333e2ac7bb0 (diff)
downloadlibhubbub-a912773ba580048b6164dfc112337a5f89e58b9b.tar.gz
libhubbub-a912773ba580048b6164dfc112337a5f89e58b9b.tar.bz2
Improve error handling
svn path=/trunk/hubbub/; revision=3886
-rw-r--r--test/testrunner.pl30
1 files changed, 20 insertions, 10 deletions
diff --git a/test/testrunner.pl b/test/testrunner.pl
index 00c54e7..0aa4586 100644
--- a/test/testrunner.pl
+++ b/test/testrunner.pl
@@ -74,11 +74,11 @@ while (my $line = <TINDEX>) {
print $msg;
# Run testcase
- $pid = open3("&<NULL", \*OUT, ">&NULL",
+ $pid = open3("&<NULL", \*OUT, \*ERR,
"./$test", "./data/Aliases",
"./data/$data/$dtest");
- my $last;
+ my $last = "FAIL";
# Marshal testcase output to log file
while (my $output = <OUT>) {
@@ -93,10 +93,15 @@ while (my $line = <TINDEX>) {
# Bail, noisily, on failure
if (substr($last, 0, 4) eq "FAIL") {
- print "\n\nFailure detected: " .
- "consult log file\n\n\n";
+ # Write any stderr output to the log
+ while (my $errors = <ERR>) {
+ print LOG " $errors";
+ }
- exit(1);
+ print "\n\nFailure detected: " .
+ "consult log file\n\n\n";
+
+ exit(1);
}
}
@@ -112,10 +117,10 @@ while (my $line = <TINDEX>) {
print $msg;
# Run testcase
- $pid = open3("&<NULL", \*OUT, "&>NULL",
+ $pid = open3("&<NULL", \*OUT, \*ERR,
"./$test", "./data/Aliases");
- my $last;
+ my $last = "FAIL";
# Marshal testcase output to log file
while (my $output = <OUT>) {
@@ -130,10 +135,15 @@ while (my $line = <TINDEX>) {
# Bail, noisily, on failure
if (substr($last, 0, 4) eq "FAIL") {
- print "\n\nFailure detected: " .
- "consult log file\n\n\n";
+ # Write any stderr output to the log
+ while (my $errors = <ERR>) {
+ print LOG " $errors";
+ }
+
+ print "\n\nFailure detected: " .
+ "consult log file\n\n\n";
- exit(1);
+ exit(1);
}
}