From cfc67e3ad4c66f16c0f0b24e92e1d41f8fd34451 Mon Sep 17 00:00:00 2001 From: Randy Stauner Date: Mon, 23 Sep 2013 18:55:01 -0700 Subject: [PATCH] Count additional diag when run in verbose mode --- Changes | 6 ++++++ t/lib/AggTestTester.pm | 9 ++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Changes b/Changes index 340fe9b..3dd3e23 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,11 @@ Revision history for Test-Aggregate +0.371 Not Released + - Fix bug in our test suite that failed to count enough diagnostics + when run under verbose mode. + Closes rt-88912 (and http://bugs.debian.org/724297). + Thanks to gregor herrmann, Debian Perl Group for reporting. + 0.370 Not Released - Fix interpolation bug that could cause 'Unrecognized escape' warning on some platforms. diff --git a/t/lib/AggTestTester.pm b/t/lib/AggTestTester.pm index 130f907..bd2927a 100644 --- a/t/lib/AggTestTester.pm +++ b/t/lib/AggTestTester.pm @@ -59,6 +59,7 @@ sub aggregator { sub run { my $self = shift; my $mod = $self->{mod}; + my $is_nested = ($mod =~ /::Nested$/); my $tb = {}; my @ran; @@ -107,7 +108,7 @@ sub run { ); # Nested sets a plan so it needs to run in a subtest. - if( $self->{mod} =~ /Nested$/ ){ + if( $is_nested ){ # Therefore we'll need to expect another ok(). push @exp_results, [1, qr/Nested/, 'Tester subtest']; Test::More::subtest(Nested => sub { $agg->run }) @@ -124,8 +125,10 @@ sub run { # Check diag to see that we ran each script. # This is redundant with the setup block test but it makes me feel good. my @exp_diags = ( - (map { qr/ \Q$_\E \(\d out of ${\scalar @{ $self->{tests} }}\)/ } - @{ $self->{tests} }), + (map { ( + (!$is_nested && $ENV{TEST_VERBOSE} ? qr/[*]{8} running tests for \Q$_\E [*]{8}/ : ()), + qr/ \Q$_\E \(\d out of ${\scalar @{ $self->{tests} }}\)/, + ) } @{ $self->{tests} }), @{ $self->{diag} }, ); my @diags = @{ $tb->{diag} };