X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F20-bad-no.t;h=fbfceaf3ead8e44091d57ca407b0dc093c19546c;hb=89371b5b8966e2ea12eb637b830034e1308762b0;hp=45170db05af7e97b9fde013722495966ce3b2627;hpb=79fe38872567977419089da38eac9406bf2d4afa;p=perl%2Fmodules%2Findirect.git diff --git a/t/20-bad-no.t b/t/20-bad-no.t index 45170db..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,22 @@ use IPC::Cmd qw/run/; = run command => [ $^X, map('-I' . $_, @INC), + $ENV{PERL5OPT} || '', '-M-indirect', '-c', 't/data/bad.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 = map { $_ => 1 } 1 .. $total; my $extra_fail = 0;