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/;
= 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;