line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test2::Workflow::Task::Group; |
2
|
47
|
|
|
47
|
|
312
|
use strict; |
|
47
|
|
|
|
|
87
|
|
|
47
|
|
|
|
|
1624
|
|
3
|
47
|
|
|
47
|
|
334
|
use warnings; |
|
47
|
|
|
|
|
88
|
|
|
47
|
|
|
|
|
2305
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.000153'; |
6
|
|
|
|
|
|
|
|
7
|
47
|
|
|
47
|
|
299
|
use Carp qw/croak/; |
|
47
|
|
|
|
|
173
|
|
|
47
|
|
|
|
|
2257
|
|
8
|
|
|
|
|
|
|
|
9
|
47
|
|
|
47
|
|
18767
|
use Test2::Workflow::Task::Action; |
|
47
|
|
|
|
|
119
|
|
|
47
|
|
|
|
|
1347
|
|
10
|
|
|
|
|
|
|
|
11
|
47
|
|
|
47
|
|
318
|
use base 'Test2::Workflow::Task'; |
|
47
|
|
|
|
|
170
|
|
|
47
|
|
|
|
|
4949
|
|
12
|
47
|
|
|
47
|
|
318
|
use Test2::Util::HashBase qw/before after primary rand variant/; |
|
47
|
|
|
|
|
133
|
|
|
47
|
|
|
|
|
219
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub init { |
15
|
520
|
|
|
520
|
0
|
7397
|
my $self = shift; |
16
|
|
|
|
|
|
|
|
17
|
520
|
100
|
|
|
|
1711
|
if (my $take = delete $self->{take}) { |
18
|
375
|
|
|
|
|
2330
|
$self->{$_} = delete $take->{$_} for ISO, ASYNC, TODO, SKIP; |
19
|
375
|
|
|
|
|
2392
|
$self->{$_} = $take->{$_} for FLAT, SCAFFOLD, NAME, CODE, FRAME; |
20
|
375
|
|
|
|
|
709
|
$take->{+FLAT} = 1; |
21
|
375
|
|
|
|
|
648
|
$take->{+SCAFFOLD} = 1; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
{ |
25
|
520
|
|
|
|
|
837
|
local $Carp::CarpLevel = $Carp::CarpLevel + 1; |
|
520
|
|
|
|
|
974
|
|
26
|
520
|
|
|
|
|
1517
|
$self->SUPER::init(); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
520
|
|
50
|
|
|
1470
|
$self->{+BEFORE} ||= []; |
30
|
520
|
|
50
|
|
|
1168
|
$self->{+AFTER} ||= []; |
31
|
520
|
|
50
|
|
|
1415
|
$self->{+PRIMARY} ||= []; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub filter { |
35
|
601
|
|
|
601
|
0
|
959
|
my $self = shift; |
36
|
601
|
|
|
|
|
1031
|
my ($filter) = @_; |
37
|
|
|
|
|
|
|
|
38
|
601
|
50
|
|
|
|
1197
|
return if $self->{+IS_ROOT}; |
39
|
|
|
|
|
|
|
|
40
|
601
|
|
|
|
|
1463
|
my $result = $self->SUPER::filter($filter); |
41
|
|
|
|
|
|
|
|
42
|
601
|
|
|
|
|
1091
|
my $child_ok = 0; |
43
|
601
|
|
|
|
|
861
|
for my $c (@{$self->{+PRIMARY}}) { |
|
601
|
|
|
|
|
1352
|
|
44
|
894
|
100
|
|
|
|
2015
|
next if $c->{+SCAFFOLD}; |
45
|
|
|
|
|
|
|
# A child matches the filter, so we should not be filtered, but also |
46
|
|
|
|
|
|
|
# should not satisfy the filter. |
47
|
430
|
|
|
|
|
859
|
my $res = $c->filter($filter); |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
# A child satisfies the filter |
50
|
430
|
100
|
100
|
|
|
1444
|
$child_ok++ if !$res || $res->{satisfied}; |
51
|
430
|
100
|
|
|
|
1158
|
last if $child_ok; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
# If the filter says we are ok |
55
|
601
|
100
|
|
|
|
1317
|
unless($result) { |
56
|
|
|
|
|
|
|
# If we are a variant then allow everything under us to be run |
57
|
78
|
100
|
100
|
|
|
492
|
return {satisfied => 1} if $self->{+VARIANT} || !$child_ok; |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
# Normal group |
60
|
8
|
|
|
|
|
23
|
return; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
523
|
100
|
|
|
|
1050
|
return if $child_ok; |
64
|
|
|
|
|
|
|
|
65
|
457
|
|
|
|
|
883
|
return $result; |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
1; |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
__END__ |