line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test2::Event::Subtest; |
2
|
246
|
|
|
246
|
|
2150
|
use strict; |
|
246
|
|
|
|
|
548
|
|
|
246
|
|
|
|
|
7328
|
|
3
|
246
|
|
|
246
|
|
1292
|
use warnings; |
|
246
|
|
|
|
|
534
|
|
|
246
|
|
|
|
|
13980
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '1.302180'; |
6
|
|
|
|
|
|
|
|
7
|
246
|
|
|
246
|
|
1564
|
BEGIN { require Test2::Event::Ok; our @ISA = qw(Test2::Event::Ok) } |
|
246
|
|
|
|
|
10760
|
|
8
|
246
|
|
|
246
|
|
1713
|
use Test2::Util::HashBase qw{subevents buffered subtest_id subtest_uuid}; |
|
246
|
|
|
|
|
613
|
|
|
246
|
|
|
|
|
1839
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub init { |
11
|
120
|
|
|
120
|
0
|
220
|
my $self = shift; |
12
|
120
|
|
|
|
|
641
|
$self->SUPER::init(); |
13
|
120
|
|
100
|
|
|
342
|
$self->{+SUBEVENTS} ||= []; |
14
|
120
|
100
|
|
|
|
336
|
if ($self->{+EFFECTIVE_PASS}) { |
15
|
108
|
|
|
|
|
186
|
$_->set_effective_pass(1) for grep { $_->can('effective_pass') } @{$self->{+SUBEVENTS}}; |
|
807
|
|
|
|
|
2236
|
|
|
108
|
|
|
|
|
361
|
|
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
{ |
20
|
246
|
|
|
246
|
|
1967
|
no warnings 'redefine'; |
|
246
|
|
|
|
|
585
|
|
|
246
|
|
|
|
|
146330
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub set_subevents { |
23
|
0
|
|
|
0
|
|
0
|
my $self = shift; |
24
|
0
|
|
|
|
|
0
|
my @subevents = @_; |
25
|
|
|
|
|
|
|
|
26
|
0
|
0
|
|
|
|
0
|
if ($self->{+EFFECTIVE_PASS}) { |
27
|
0
|
|
|
|
|
0
|
$_->set_effective_pass(1) for grep { $_->can('effective_pass') } @subevents; |
|
0
|
|
|
|
|
0
|
|
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
0
|
|
|
|
|
0
|
$self->{+SUBEVENTS} = \@subevents; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub set_effective_pass { |
34
|
69
|
|
|
69
|
0
|
118
|
my $self = shift; |
35
|
69
|
|
|
|
|
130
|
my ($pass) = @_; |
36
|
|
|
|
|
|
|
|
37
|
69
|
50
|
0
|
|
|
130
|
if ($pass) { |
|
|
0
|
|
|
|
|
|
38
|
69
|
|
|
|
|
99
|
$_->set_effective_pass(1) for grep { $_->can('effective_pass') } @{$self->{+SUBEVENTS}}; |
|
452
|
|
|
|
|
1123
|
|
|
69
|
|
|
|
|
137
|
|
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
elsif ($self->{+EFFECTIVE_PASS} && !$pass) { |
41
|
0
|
|
|
|
|
0
|
for my $s (grep { $_->can('effective_pass') } @{$self->{+SUBEVENTS}}) { |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
42
|
0
|
0
|
0
|
|
|
0
|
$_->set_effective_pass(0) unless $s->can('todo') && defined $s->todo; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
69
|
|
|
|
|
162
|
$self->{+EFFECTIVE_PASS} = $pass; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub summary { |
51
|
4
|
|
|
4
|
1
|
8
|
my $self = shift; |
52
|
|
|
|
|
|
|
|
53
|
4
|
|
100
|
|
|
14
|
my $name = $self->{+NAME} || "Nameless Subtest"; |
54
|
|
|
|
|
|
|
|
55
|
4
|
|
|
|
|
9
|
my $todo = $self->{+TODO}; |
56
|
4
|
100
|
|
|
|
13
|
if ($todo) { |
|
|
100
|
|
|
|
|
|
57
|
1
|
|
|
|
|
4
|
$name .= " (TODO: $todo)"; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
elsif (defined $todo) { |
60
|
1
|
|
|
|
|
4
|
$name .= " (TODO)"; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
4
|
|
|
|
|
19
|
return $name; |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
sub facet_data { |
67
|
257
|
|
|
257
|
1
|
445
|
my $self = shift; |
68
|
|
|
|
|
|
|
|
69
|
257
|
|
|
|
|
966
|
my $out = $self->SUPER::facet_data(); |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
$out->{parent} = { |
72
|
|
|
|
|
|
|
hid => $self->subtest_id, |
73
|
1568
|
|
|
|
|
3589
|
children => [map {$_->facet_data} @{$self->{+SUBEVENTS}}], |
|
257
|
|
|
|
|
801
|
|
74
|
257
|
|
|
|
|
1143
|
buffered => $self->{+BUFFERED}, |
75
|
|
|
|
|
|
|
}; |
76
|
|
|
|
|
|
|
|
77
|
257
|
|
|
|
|
1025
|
return $out; |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
sub add_amnesty { |
81
|
15
|
|
|
15
|
1
|
30
|
my $self = shift; |
82
|
|
|
|
|
|
|
|
83
|
15
|
|
|
|
|
44
|
for my $am (@_) { |
84
|
15
|
50
|
|
|
|
106
|
$am = {%$am} if ref($am) ne 'ARRAY'; |
85
|
15
|
|
|
|
|
71
|
$am = Test2::EventFacet::Amnesty->new($am); |
86
|
|
|
|
|
|
|
|
87
|
15
|
|
|
|
|
35
|
push @{$self->{+AMNESTY}} => $am; |
|
15
|
|
|
|
|
52
|
|
88
|
|
|
|
|
|
|
|
89
|
15
|
|
|
|
|
27
|
for my $e (@{$self->{+SUBEVENTS}}) { |
|
15
|
|
|
|
|
39
|
|
90
|
96
|
|
|
|
|
238
|
$e->add_amnesty($am->clone(inherited => 1)); |
91
|
|
|
|
|
|
|
} |
92
|
|
|
|
|
|
|
} |
93
|
|
|
|
|
|
|
} |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
1; |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
__END__ |