From: Vincent Pit Date: Sun, 9 Sep 2012 09:15:43 +0000 (+0200) Subject: Update VPIT::TestHandlers X-Git-Tag: v0.20~22 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=6d9ec3d17a2589cf3a259893f7ae752f5474ecf5;p=perl%2Fmodules%2FScope-Upper.git Update VPIT::TestHandlers --- diff --git a/t/lib/VPIT/TestHelpers.pm b/t/lib/VPIT/TestHelpers.pm index 18f2b17..42ff189 100644 --- a/t/lib/VPIT/TestHelpers.pm +++ b/t/lib/VPIT/TestHelpers.pm @@ -16,15 +16,24 @@ sub import { } } -sub skip_all { - my ($msg) = @_; - require Test::More; - Test::More::plan(skip_all => $msg); -} +my $test_sub = sub { + my $sub = shift; + my $stash; + if ($INC{'Test/Leaner.pm'}) { + $stash = \%Test::Leaner::; + } else { + require Test::More; + $stash = \%Test::More::; + } + my $glob = $stash->{$sub}; + return $glob ? *$glob{CODE} : undef; +}; + +sub skip_all { $test_sub->('plan')->(skip_all => $_[0]) } sub diag { - require Test::More; - Test::More::diag($_) for @_; + my $diag = $test_sub->('diag'); + $diag->($_) for @_; } our $TODO; @@ -51,6 +60,8 @@ IMPORTER } diag "Using $pkg $ver"; } else { + (my $file = "$pkg.pm") =~ s{::}{/}g; + delete $INC{$file}; skip_all "$spec $desc"; } }