From: Vincent Pit Date: Sun, 28 Sep 2008 12:58:27 +0000 (+0200) Subject: Don't try to read the script's output before valgrind's, as it causes deadlocks X-Git-Tag: v0.07~5 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=d3122f78d2a044f117a0e03fbc7dbd45d603eb47;p=perl%2Fmodules%2FTest-Valgrind.git Don't try to read the script's output before valgrind's, as it causes deadlocks --- diff --git a/lib/Test/Valgrind.pm b/lib/Test/Valgrind.pm index b403e0f..c76231d 100644 --- a/lib/Test/Valgrind.pm +++ b/lib/Test/Valgrind.pm @@ -196,8 +196,6 @@ sub import { ); my %res = map { $_ => 0 } @tests; close $owtr or die "close(\$owtr): $!"; - $Test->diag(do { local $/; <$ordr> }) if $args{diag}; - close $ordr or die "close(\$ordr): $!"; close $vwtr or die "close(\$vwtr): $!"; while (<$vrdr>) { $Test->diag($_) if $args{diag}; @@ -218,6 +216,8 @@ sub import { } } waitpid $pid, 0; + $Test->diag(do { local $/; <$ordr> }) if $args{diag}; + close $ordr or die "close(\$ordr): $!"; my $failed = 5; my $cb = ($args{no_test} ? \&_counter : ($args{cb} ? $args{cb} : \&_tester));