X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2Findirect.git;a=blobdiff_plain;f=t%2F20-bad-no.t;h=fbfceaf3ead8e44091d57ca407b0dc093c19546c;hp=0980b1fdabca524b181c420f024c4befc567738b;hb=7f756d0f409eb87eb7900dafdb81428e4367021b;hpb=c579771bace4977e6f2c26a5e5e29740a1aa4553 diff --git a/t/20-bad-no.t b/t/20-bad-no.t index 0980b1f..fbfceaf 100644 --- a/t/20-bad-no.t +++ b/t/20-bad-no.t @@ -3,12 +3,9 @@ use strict; use warnings; -my $total; -BEGIN { - $total = 28; -} +my $total = 28; -use Test::More tests => $total + 1; +use Test::More; use IPC::Cmd qw/run/; @@ -16,15 +13,21 @@ use IPC::Cmd qw/run/; = run command => [ $^X, map('-I' . $_, @INC), + $ENV{PERL5OPT} || '', '-M-indirect', '-c', 't/data/bad.d' ]; -$stderr = join '', @$stderr; + +plan skip_all => "Couldn't capture buffers" if $success and not defined $stderr; +plan tests => $total + 1; + +$stderr = join '', @{$stderr || []}; unless ($success) { diag $stderr; diag "Failed to execute data file (error $err_code)"; fail "Couldn't run test $_" for 1 .. $total + 1; + exit $total + 1; } my %fail = map { $_ => 1 } 1 .. $total;