X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2Findirect.git;a=blobdiff_plain;f=t%2F11-good-use.t;h=6f0025426fe54b10aa5935397eff0eaba92d5954;hp=93b24357b9f34380334201dcd0f404af4c1d31d0;hb=7f756d0f409eb87eb7900dafdb81428e4367021b;hpb=79fe38872567977419089da38eac9406bf2d4afa diff --git a/t/11-good-use.t b/t/11-good-use.t index 93b2435..6f00254 100644 --- a/t/11-good-use.t +++ b/t/11-good-use.t @@ -3,12 +3,9 @@ use strict; use warnings; -my $total; -BEGIN { - $total = 32; -} +my $total = 32; -use Test::More tests => $total + 1; +use Test::More; use IPC::Cmd qw/run/; @@ -16,15 +13,22 @@ use IPC::Cmd qw/run/; = run command => [ $^X, map('-I' . $_, @INC), + $ENV{PERL5OPT} || '', '-Mindirect', '-c', 't/data/good.d' ]; + +plan skip_all => "Couldn't capture buffers" if $success and not defined $stderr; +plan tests => $total + 1; + +$stderr = join '', @{$stderr || []}; unless ($success) { - $stderr = pop @$stderr if ref $stderr eq 'ARRAY'; - BAIL_OUT("Failed to execute data file (error $err_code) : $stderr"); + diag $stderr; + diag "Failed to execute data file (error $err_code)"; + fail "Couldn't run test $_" for 1 .. $total + 1; + exit $total + 1; } -$stderr = join "\n", @$stderr if ref $stderr eq 'ARRAY'; my %fail; my $extra_fail = 0;