| 1 | package Test2::AsyncSubtest::Hub; | ||||||||||||||||||||||||||||
| 2 | 72 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 3 | 72 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | 72 | our $VERSION = '1.302226'; | |||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 72 | ▶ | use base 'Test2::Hub::Subtest'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | 72 | ▶ | use Test2::Util::HashBase qw/ast_ids ast/; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | 72 | ▶ | use Test2::Util qw/get_tid/; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | 72 | my $NO_WARN_FOR_PLAN = 0; | |||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | 0 | ▶ | sub do_not_warn_on_plan { $NO_WARN_FOR_PLAN = 1 }; | ||||||||||||||||||||||||||
|
Subroutine
do_not_warn_on_plan: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | 511 | ▶ | sub init { | ||||||||||||||||||||||||||
|
Subroutine
init: called CC=4 SCAR=14.1
Pod
undocumented
| |||||||||||||||||||||||||||||
| 16 | 511 | my $self = shift; | |||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | 511 | $self->SUPER::init(); | |||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | 511 | ▶ | if (my $format = $self->format) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 21 | 133 | ▶ | my $hide = $format->can('hide_buffered') ? $format->hide_buffered : 1; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 22 | 133 | ▶ | $self->format(undef) if $hide; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 23 | } | ||||||||||||||||||||||||||||
| 24 | } | ||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | 253 | ▶ | sub inherit { | ||||||||||||||||||||||||||
|
Subroutine
inherit: called CC=4 SCAR=16.1
Pod
undocumented
| |||||||||||||||||||||||||||||
| 27 | 253 | my $self = shift; | |||||||||||||||||||||||||||
| 28 | 253 | my ($from, %params) = @_; | |||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | 253 | ▶ | if (my $ls = $from->{+_LISTENERS}) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 31 | 182 | push @{$self->{+_LISTENERS}} => grep { $_->{inherit} } @$ls; | |||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | 253 | ▶ | if (my $pfs = $from->{+_PRE_FILTERS}) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 35 | 0 | push @{$self->{+_PRE_FILTERS}} => grep { $_->{inherit} } @$pfs; | |||||||||||||||||||||||||||
| 36 | } | ||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | 253 | ▶ | if (my $fs = $from->{+_FILTERS}) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 39 | 0 | push @{$self->{+_FILTERS}} => grep { $_->{inherit} } @$fs; | |||||||||||||||||||||||||||
| 40 | } | ||||||||||||||||||||||||||||
| 41 | } | ||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||
| 43 | 1460 | ▶ | sub send { | ||||||||||||||||||||||||||
|
Subroutine
send: called CC=7 SCAR=19.5
Pod
documented
| |||||||||||||||||||||||||||||
| 44 | 1460 | my $self = shift; | |||||||||||||||||||||||||||
| 45 | 1460 | my ($e) = @_; | |||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||
| 47 | 1460 | ▶ | unless ($NO_WARN_FOR_PLAN) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 48 | 1460 | ▶ | if (my $ast = $self->ast) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 49 | 1456 | ▶ | if ($$ != $ast->pid || get_tid != $ast->tid) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$$ != $ast->pid or 0 != $ast->tid
MC/DC50%1/2
$$ != $ast->pid or 0 != $ast->tid
$$ != $ast->pid
0 != $ast->tid
Truth table66%2/3
A or B
A= $$ != $ast->pidB= 0 != $ast->tid
| |||||||||||||||||||||||||||||
| 50 | 164 | ▶ | if (my $plan = $e->facet_data->{plan}) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 51 | 18 | ▶ | unless ($plan->{skip}) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 52 | 1 | my $trace = $e->facet_data->{trace}; | |||||||||||||||||||||||||||
| 53 | 1 | bless($trace, 'Test2::EventFacet::Trace'); | |||||||||||||||||||||||||||
| 54 | 1 | $trace->alert("A plan should not be set inside an async-subtest (did you call done_testing()?)"); | |||||||||||||||||||||||||||
| 55 | 1 | return; | |||||||||||||||||||||||||||
| 56 | } | ||||||||||||||||||||||||||||
| 57 | } | ||||||||||||||||||||||||||||
| 58 | } | ||||||||||||||||||||||||||||
| 59 | } | ||||||||||||||||||||||||||||
| 60 | } | ||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||
| 62 | 1459 | return $self->SUPER::send($e); | |||||||||||||||||||||||||||
| 63 | } | ||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||
| 65 | 72 | 1; | |||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||
| 67 | __END__ | ||||||||||||||||||||||||||||