From: Vincent Pit Date: Mon, 11 Aug 2008 14:46:14 +0000 (+0200) Subject: Skip when we couldn't capture buffers X-Git-Tag: v0.02~4 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2Findirect.git;a=commitdiff_plain;h=1d3c3341b0d1f0192c3189d47a5b8bc78176e9db Skip when we couldn't capture buffers --- diff --git a/t/10-good-no.t b/t/10-good-no.t index ac16d46..71d5668 100644 --- a/t/10-good-no.t +++ b/t/10-good-no.t @@ -3,12 +3,9 @@ use strict; use warnings; -my $total; -BEGIN { - $total = 32; -} +my $total = 32; -use Test::More tests => $total + 1; +use Test::More; use IPC::Cmd qw/run/; @@ -20,6 +17,10 @@ use IPC::Cmd qw/run/; '-c', 't/data/good.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; diff --git a/t/11-good-use.t b/t/11-good-use.t index f157611..8cf224a 100644 --- a/t/11-good-use.t +++ b/t/11-good-use.t @@ -3,12 +3,9 @@ use strict; use warnings; -my $total; -BEGIN { - $total = 32; -} +my $total = 32; -use Test::More tests => $total + 1; +use Test::More; use IPC::Cmd qw/run/; @@ -20,6 +17,10 @@ use IPC::Cmd qw/run/; '-c', 't/data/good.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; diff --git a/t/20-bad-no.t b/t/20-bad-no.t index 0980b1f..a5dfd2a 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/; @@ -20,6 +17,10 @@ use IPC::Cmd qw/run/; '-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) { diag $stderr; diff --git a/t/21-bad-use.t b/t/21-bad-use.t index 1499b2b..5993d24 100644 --- a/t/21-bad-use.t +++ b/t/21-bad-use.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/; @@ -20,6 +17,10 @@ use IPC::Cmd qw/run/; '-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) { diag $stderr; diff --git a/t/22-bad-fatal.t b/t/22-bad-fatal.t index 64348d9..e374a8d 100644 --- a/t/22-bad-fatal.t +++ b/t/22-bad-fatal.t @@ -3,12 +3,7 @@ use strict; use warnings; -my $total; -BEGIN { - $total = 20; -} - -use Test::More tests => 1; +use Test::More; use IPC::Cmd qw/run/; @@ -21,5 +16,8 @@ use IPC::Cmd qw/run/; 't/data/bad.d' ]; +plan skip_all => "Couldn't capture buffers" if $success and not defined $stderr; +plan tests => 1; + $stderr = join '', @$stderr; ok(!$success && $err_code && $stderr =~ /^Indirect\s+call\s+of\s+method\s+"new"\s+on\s+object\s+"Hlagh1"/mg, 'croak when :fatal is specified'); diff --git a/t/30-scope.t b/t/30-scope.t index f006f81..0174870 100644 --- a/t/30-scope.t +++ b/t/30-scope.t @@ -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,6 +16,10 @@ 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;