From: Vincent Pit Date: Mon, 11 Aug 2008 12:28:13 +0000 (+0200) Subject: Show more information when we couldn't run the tests data files X-Git-Tag: v0.02~8 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=c579771bace4977e6f2c26a5e5e29740a1aa4553;p=perl%2Fmodules%2Findirect.git Show more information when we couldn't run the tests data files --- diff --git a/t/10-good-no.t b/t/10-good-no.t index 37514dd..ac16d46 100644 --- a/t/10-good-no.t +++ b/t/10-good-no.t @@ -20,11 +20,12 @@ use IPC::Cmd qw/run/; '-c', 't/data/good.d' ]; +$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; } -$stderr = join "\n", @$stderr if ref $stderr eq 'ARRAY'; my %fail; my $extra_fail = 0; diff --git a/t/11-good-use.t b/t/11-good-use.t index 93b2435..f157611 100644 --- a/t/11-good-use.t +++ b/t/11-good-use.t @@ -20,11 +20,12 @@ use IPC::Cmd qw/run/; '-c', 't/data/good.d' ]; +$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; } -$stderr = join "\n", @$stderr if ref $stderr eq 'ARRAY'; my %fail; my $extra_fail = 0; diff --git a/t/20-bad-no.t b/t/20-bad-no.t index 45170db..0980b1f 100644 --- a/t/20-bad-no.t +++ b/t/20-bad-no.t @@ -20,11 +20,12 @@ use IPC::Cmd qw/run/; '-c', 't/data/bad.d' ]; +$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; } -$stderr = join "\n", @$stderr if ref $stderr eq 'ARRAY'; my %fail = map { $_ => 1 } 1 .. $total; my $extra_fail = 0; diff --git a/t/21-bad-use.t b/t/21-bad-use.t index eafd05c..1499b2b 100644 --- a/t/21-bad-use.t +++ b/t/21-bad-use.t @@ -20,11 +20,12 @@ use IPC::Cmd qw/run/; '-c', 't/data/bad.d' ]; +$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; } -$stderr = join "\n", @$stderr if ref $stderr eq 'ARRAY'; my %fail; my $extra_fail = 0; diff --git a/t/22-bad-fatal.t b/t/22-bad-fatal.t index 6fd910a..64348d9 100644 --- a/t/22-bad-fatal.t +++ b/t/22-bad-fatal.t @@ -21,5 +21,5 @@ use IPC::Cmd qw/run/; 't/data/bad.d' ]; -$stderr = join "\n", @$stderr if ref $stderr eq 'ARRAY'; +$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 eafc59c..f006f81 100644 --- a/t/30-scope.t +++ b/t/30-scope.t @@ -19,11 +19,12 @@ use IPC::Cmd qw/run/; '-c', 't/data/mixed.d' ]; +$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; } -$stderr = join "\n", @$stderr if ref $stderr eq 'ARRAY'; my %fail = map { $_ => 1 } 2, 3, 5, 7; my %failed;