X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=lib%2FTest%2FLeaner.pm;h=5e2f0a5f227e488256aa9677155c20763fe12a78;hb=c966261ac55fcb079dfc1bf42b1152b4bb71bd0b;hp=f0f490eba2ed5f9930d44a8d7de7c5f10c5b15dd;hpb=41367a04c268486fb815420a103f80e28ffefd63;p=perl%2Fmodules%2FTest-Leaner.git diff --git a/lib/Test/Leaner.pm b/lib/Test/Leaner.pm index f0f490e..5e2f0a5 100644 --- a/lib/Test/Leaner.pm +++ b/lib/Test/Leaner.pm @@ -25,22 +25,26 @@ BEGIN { } } -my ($plan, $test, $failed, $no_diag); +my $TAP_STREAM = *STDOUT; +my $DIAG_STREAM = *STDERR; + +my ($plan, $test, $failed, $no_diag, $done_testing); sub NO_PLAN () { -1 } sub SKIP_ALL () { -2 } BEGIN { - threads::shared::share($plan), lock $plan if THREADSAFE; + if (THREADSAFE) { + threads::shared::share($_) for $plan, $test, $failed, $no_diag; + } + + lock $plan if THREADSAFE; $plan = undef; $test = 0; $failed = 0; } -my $TAP_STREAM = *STDOUT; -my $DIAG_STREAM = *STDERR; - sub carp { my $level = 1 + ($Test::Builder::Level || 0); my ($file, $line) = (caller $level)[1, 2]; @@ -118,6 +122,7 @@ our @EXPORT = qw< ok is isnt + cmp_ok like unlike diag @@ -194,8 +199,6 @@ sub skip { last SKIP; } -my $done_testing; - sub done_testing { my ($count) = @_; @@ -328,7 +331,7 @@ sub cmp_ok ($$$;$) { croak("Operator $op not supported") unless defined $name; @_ = ($x, $y, $desc); no strict 'refs'; - goto &{__PACKAGE__."is_$name"}; + goto &{__PACKAGE__."::is_$name"}; } sub _diag_fh {