]> git.vpit.fr Git - perl/modules/indirect.git/blobdiff - t/30-scope.t
Add PERL5OPT to the flags passed to the forked perls
[perl/modules/indirect.git] / t / 30-scope.t
index eafc59c67b466d7258e7517b1a8bd8fccca7138f..2eceddb401b03cb92981e3763ee0c5d3401515b5 100644 (file)
@@ -3,12 +3,9 @@
 use strict;
 use warnings;
 
-my $total;
-BEGIN {
- $total = 8;
-}
+my $total = 8;
 
-use Test::More tests => $total + 1;
+use Test::More;
 
 use IPC::Cmd qw/run/;
 
@@ -16,14 +13,21 @@ use IPC::Cmd qw/run/;
  = run command => [
           $^X,
           map('-I' . $_, @INC),
+          $ENV{PERL5OPT} || '',
           '-c',
           't/data/mixed.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 } 2, 3, 5, 7;
 my %failed;