From 50a9f76ddeed6024c868b146a3069b821d007646 Mon Sep 17 00:00:00 2001 From: brectanus Date: Thu, 7 Feb 2008 22:23:39 +0000 Subject: [PATCH] Fixed getting exit code for determining test status. --- apache2/t/run-tests.pl.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apache2/t/run-tests.pl.in b/apache2/t/run-tests.pl.in index 9d2fd4a2..238cac29 100755 --- a/apache2/t/run-tests.pl.in +++ b/apache2/t/run-tests.pl.in @@ -76,6 +76,7 @@ sub runfile { my $out; my $test_in = new FileHandle(); my $test_out = new FileHandle(); + my $test_pid; my $rc = 0; my $param; @@ -91,11 +92,12 @@ sub runfile { @test = ($t{type}, $t{name}, $param, (exists($t{ret}) ? ($t{ret}) : ())); $teststr = "$TEST " . join(" ", map { "\"$_\"" } @test); - open2($test_out, $test_in, $TEST, @test) or quit(1, "Failed to execute test: $teststr\": $!"); + $test_pid = open2($test_out, $test_in, $TEST, @test) or quit(1, "Failed to execute test: $teststr\": $!"); print $test_in "$in"; close $test_in; $out = join("\\n", split(/\n/, <$test_out>)); close $test_out; + waitpid($test_pid, 0); $rc = $?; if ( WIFEXITED($rc) ) {