| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Test2::Workflow::Task::Group; |
|
2
|
46
|
|
|
46
|
|
94606
|
use strict; |
|
|
46
|
|
|
|
|
46
|
|
|
|
46
|
|
|
|
|
1366
|
|
|
3
|
46
|
|
|
46
|
|
141
|
use warnings; |
|
|
46
|
|
|
|
|
47
|
|
|
|
46
|
|
|
|
|
910
|
|
|
4
|
|
|
|
|
|
|
|
|
5
|
46
|
|
|
46
|
|
110
|
use Carp qw/croak/; |
|
|
46
|
|
|
|
|
52
|
|
|
|
46
|
|
|
|
|
1490
|
|
|
6
|
|
|
|
|
|
|
|
|
7
|
46
|
|
|
46
|
|
14232
|
use Test2::Workflow::Task::Action; |
|
|
46
|
|
|
|
|
70
|
|
|
|
46
|
|
|
|
|
865
|
|
|
8
|
|
|
|
|
|
|
|
|
9
|
46
|
|
|
46
|
|
151
|
use base 'Test2::Workflow::Task'; |
|
|
46
|
|
|
|
|
44
|
|
|
|
46
|
|
|
|
|
2409
|
|
|
10
|
46
|
|
|
46
|
|
150
|
use Test2::Util::HashBase qw/before after primary rand variant/; |
|
|
46
|
|
|
|
|
45
|
|
|
|
46
|
|
|
|
|
127
|
|
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub init { |
|
13
|
518
|
|
|
518
|
0
|
2969
|
my $self = shift; |
|
14
|
|
|
|
|
|
|
|
|
15
|
518
|
100
|
|
|
|
1071
|
if (my $take = delete $self->{take}) { |
|
16
|
375
|
|
|
|
|
1555
|
$self->{$_} = delete $take->{$_} for ISO, ASYNC, TODO, SKIP; |
|
17
|
375
|
|
|
|
|
1631
|
$self->{$_} = $take->{$_} for FLAT, SCAFFOLD, NAME, CODE, FRAME; |
|
18
|
375
|
|
|
|
|
323
|
$take->{+FLAT} = 1; |
|
19
|
375
|
|
|
|
|
375
|
$take->{+SCAFFOLD} = 1; |
|
20
|
|
|
|
|
|
|
} |
|
21
|
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
{ |
|
23
|
518
|
|
|
|
|
418
|
local $Carp::CarpLevel = $Carp::CarpLevel + 1; |
|
|
518
|
|
|
|
|
555
|
|
|
24
|
518
|
|
|
|
|
879
|
$self->SUPER::init(); |
|
25
|
|
|
|
|
|
|
} |
|
26
|
|
|
|
|
|
|
|
|
27
|
518
|
|
50
|
|
|
815
|
$self->{+BEFORE} ||= []; |
|
28
|
518
|
|
50
|
|
|
778
|
$self->{+AFTER} ||= []; |
|
29
|
518
|
|
50
|
|
|
965
|
$self->{+PRIMARY} ||= []; |
|
30
|
|
|
|
|
|
|
} |
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub filter { |
|
33
|
601
|
|
|
601
|
0
|
450
|
my $self = shift; |
|
34
|
601
|
|
|
|
|
431
|
my ($filter) = @_; |
|
35
|
|
|
|
|
|
|
|
|
36
|
601
|
50
|
|
|
|
700
|
return if $self->{+IS_ROOT}; |
|
37
|
|
|
|
|
|
|
|
|
38
|
601
|
|
|
|
|
1163
|
my $result = $self->SUPER::filter($filter); |
|
39
|
|
|
|
|
|
|
|
|
40
|
601
|
|
|
|
|
429
|
my $child_ok = 0; |
|
41
|
601
|
|
|
|
|
367
|
for my $c (@{$self->{+PRIMARY}}) { |
|
|
601
|
|
|
|
|
721
|
|
|
42
|
894
|
100
|
|
|
|
1283
|
next if $c->{+SCAFFOLD}; |
|
43
|
|
|
|
|
|
|
# A child matches the filter, so we should not be filtered, but also |
|
44
|
|
|
|
|
|
|
# should not satisfy the filter. |
|
45
|
430
|
|
|
|
|
480
|
my $res = $c->filter($filter); |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
# A child satisfies the filter |
|
48
|
430
|
100
|
66
|
|
|
824
|
$child_ok++ if !$res || $res->{satisfied}; |
|
49
|
430
|
100
|
|
|
|
680
|
last if $child_ok; |
|
50
|
|
|
|
|
|
|
} |
|
51
|
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
# If the filter says we are ok |
|
53
|
601
|
100
|
|
|
|
729
|
unless($result) { |
|
54
|
|
|
|
|
|
|
# If we are a variant then allow everything under us to be run |
|
55
|
78
|
100
|
100
|
|
|
320
|
return {satisfied => 1} if $self->{+VARIANT} || !$child_ok; |
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
# Normal group |
|
58
|
8
|
|
|
|
|
10
|
return; |
|
59
|
|
|
|
|
|
|
} |
|
60
|
|
|
|
|
|
|
|
|
61
|
523
|
100
|
|
|
|
627
|
return if $child_ok; |
|
62
|
|
|
|
|
|
|
|
|
63
|
457
|
|
|
|
|
467
|
return $result; |
|
64
|
|
|
|
|
|
|
} |
|
65
|
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
1; |
|
67
|
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
__END__ |