]> git.vpit.fr Git - perl/modules/indirect.git/blobdiff - t/30-scope.t
Actually exit when the child didn't succeed
[perl/modules/indirect.git] / t / 30-scope.t
index f006f8147a699764b0432e14b764fc2c2d3effaa..b9c71545dd1ede3a5627eea26f4c74a3a01ca944 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/;
 
@@ -19,11 +16,16 @@ use IPC::Cmd qw/run/;
           '-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) {
  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 } 2, 3, 5, 7;