diff options
Diffstat (limited to 'cpan/Test-Simple/lib/Test2/Hub.pm')
-rw-r--r-- | cpan/Test-Simple/lib/Test2/Hub.pm | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/cpan/Test-Simple/lib/Test2/Hub.pm b/cpan/Test-Simple/lib/Test2/Hub.pm index edc873bc1a..d15912dc4b 100644 --- a/cpan/Test-Simple/lib/Test2/Hub.pm +++ b/cpan/Test-Simple/lib/Test2/Hub.pm @@ -2,7 +2,7 @@ package Test2::Hub; use strict; use warnings; -our $VERSION = '1.302059'; +our $VERSION = '1.302062'; use Carp qw/carp croak confess/; @@ -54,6 +54,8 @@ sub init { } } +sub is_subtest { 0 } + sub reset_state { my $self = shift; @@ -300,7 +302,10 @@ sub process { return $e if $is_ok || $no_fail; my $code = $e->terminate; - $self->terminate($code, $e) if defined $code; + if (defined $code) { + $self->{+_FORMATTER}->terminate($e) if $self->{+_FORMATTER}; + $self->terminate($code, $e); + } return $e; } @@ -332,8 +337,11 @@ sub finalize { my $failed = $self->{+FAILED}; my $active = $self->{+ACTIVE}; - # return if NOTHING was done. - return unless $active || $do_plan || defined($plan) || $count || $failed; + # return if NOTHING was done. + unless ($active || $do_plan || defined($plan) || $count || $failed) { + $self->{+_FORMATTER}->finalize($plan, $count, $failed, 0, $self->is_subtest) if $self->{+_FORMATTER}; + return; + } unless ($self->{+ENDED}) { if ($self->{+_FOLLOW_UPS}) { @@ -369,7 +377,11 @@ Second End: $sfile line $sline } $self->{+ENDED} = $frame; - $self->is_passing(); # Generate the final boolean. + my $pass = $self->is_passing(); # Generate the final boolean. + + $self->{+_FORMATTER}->finalize($plan, $count, $failed, $pass, $self->is_subtest) if $self->{+_FORMATTER}; + + return $pass; } sub is_passing { |