From: Vincent Pit Date: Tue, 18 Sep 2012 20:44:27 +0000 (+0200) Subject: Update VPIT::TestHelpers X-Git-Tag: v0.940.0~2 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=1b023b1e517f8fa66abf992a35b0000f483dfd8e;p=perl%2Fmodules%2FTask-Devel-Cover-Recommended.git Update VPIT::TestHelpers --- 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"; } }