Skip to content

Commit

Permalink
Count additional diag when run in verbose mode
Browse files Browse the repository at this point in the history
  • Loading branch information
rwstauner committed Sep 24, 2013
1 parent 5ab1cef commit cfc67e3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
6 changes: 6 additions & 0 deletions 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.
Expand Down
9 changes: 6 additions & 3 deletions t/lib/AggTestTester.pm
Expand Up @@ -59,6 +59,7 @@ sub aggregator {
sub run {
my $self = shift;
my $mod = $self->{mod};
my $is_nested = ($mod =~ /::Nested$/);
my $tb = {};
my @ran;

Expand Down Expand Up @@ -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 })
Expand All @@ -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} };
Expand Down

0 comments on commit cfc67e3

Please sign in to comment.