X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=lib%2FVPIT%2FTestHelpers.pm;h=abee64079108f825b1be4d9d0138f6dccc5c9a03;hb=682b551acf9fe02f67ad76a2c1825a71c92bf762;hp=18f2b175570ca4ca6c36faeab56d589c7b256dca;hpb=175a35da3242fd96fb4aeccac36c1bb72e9a21ca;p=perl%2Fmodules%2FVPIT-TestHelpers.git diff --git a/lib/VPIT/TestHelpers.pm b/lib/VPIT/TestHelpers.pm index 18f2b17..abee640 100644 --- a/lib/VPIT/TestHelpers.pm +++ b/lib/VPIT/TestHelpers.pm @@ -16,15 +16,23 @@ 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::; + } + return $stash->{$sub}; +}; + +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 +59,8 @@ IMPORTER } diag "Using $pkg $ver"; } else { + (my $file = "$pkg.pm") =~ s{::}{/}g; + delete $INC{$file}; skip_all "$spec $desc"; } }