From: Vincent Pit Date: Wed, 29 Dec 2010 16:40:58 +0000 (+0100) Subject: Only run the END block in the main process X-Git-Tag: v0.02~1 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FTest-Leaner.git;a=commitdiff_plain;h=e5c7c89a9b1bfdcaf3f5ed28eafae825ec9aad8d Only run the END block in the main process This prevents from outputting the plan several times at the end when the process is forked and 'no_plan' was specified. --- diff --git a/lib/Test/Leaner.pm b/lib/Test/Leaner.pm index 896582b..3881656 100644 --- a/lib/Test/Leaner.pm +++ b/lib/Test/Leaner.pm @@ -72,7 +72,11 @@ C, C, C, C, C, C, C= 5.008 and $INC{'threads.pm'}) { my $use_ithreads = do { require Config; @@ -759,7 +763,7 @@ sub BAIL_OUT { } END { - unless ($?) { + if ($main_process == $$ and not $?) { lock $plan if THREADSAFE; if (defined $plan) {