]> git.vpit.fr Git - perl/modules/indirect.git/blobdiff - t/21-bad-use.t
Better logic for finding oo and om in ck_entersub
[perl/modules/indirect.git] / t / 21-bad-use.t
index eafd05c9e6b3588e020b9a7cb8d4c63ba4d441f5..dca71d4b0244f5e5a041869a6ffe72423310f1f6 100644 (file)
@@ -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} || '',
           '-Mindirect',
           '-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;
 my $extra_fail = 0;