line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test2::Workflow::Task::Group; |
2
|
46
|
|
|
46
|
|
130687
|
use strict; |
|
46
|
|
|
|
|
54
|
|
|
46
|
|
|
|
|
944
|
|
3
|
46
|
|
|
46
|
|
140
|
use warnings; |
|
46
|
|
|
|
|
38
|
|
|
46
|
|
|
|
|
910
|
|
4
|
|
|
|
|
|
|
|
5
|
46
|
|
|
46
|
|
131
|
use Carp qw/croak/; |
|
46
|
|
|
|
|
55
|
|
|
46
|
|
|
|
|
1535
|
|
6
|
|
|
|
|
|
|
|
7
|
46
|
|
|
46
|
|
14499
|
use Test2::Workflow::Task::Action; |
|
46
|
|
|
|
|
72
|
|
|
46
|
|
|
|
|
889
|
|
8
|
|
|
|
|
|
|
|
9
|
46
|
|
|
46
|
|
156
|
use base 'Test2::Workflow::Task'; |
|
46
|
|
|
|
|
47
|
|
|
46
|
|
|
|
|
2556
|
|
10
|
46
|
|
|
46
|
|
141
|
use Test2::Util::HashBase qw/before after primary rand variant/; |
|
46
|
|
|
|
|
47
|
|
|
46
|
|
|
|
|
135
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub init { |
13
|
518
|
|
|
518
|
0
|
3282
|
my $self = shift; |
14
|
|
|
|
|
|
|
|
15
|
518
|
100
|
|
|
|
1119
|
if (my $take = delete $self->{take}) { |
16
|
375
|
|
|
|
|
1745
|
$self->{$_} = delete $take->{$_} for ISO, ASYNC, TODO, SKIP; |
17
|
375
|
|
|
|
|
1733
|
$self->{$_} = $take->{$_} for FLAT, SCAFFOLD, NAME, CODE, FRAME; |
18
|
375
|
|
|
|
|
380
|
$take->{+FLAT} = 1; |
19
|
375
|
|
|
|
|
322
|
$take->{+SCAFFOLD} = 1; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
{ |
23
|
518
|
|
|
|
|
465
|
local $Carp::CarpLevel = $Carp::CarpLevel + 1; |
|
518
|
|
|
|
|
550
|
|
24
|
518
|
|
|
|
|
1149
|
$self->SUPER::init(); |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
518
|
|
50
|
|
|
921
|
$self->{+BEFORE} ||= []; |
28
|
518
|
|
50
|
|
|
738
|
$self->{+AFTER} ||= []; |
29
|
518
|
|
50
|
|
|
997
|
$self->{+PRIMARY} ||= []; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub filter { |
33
|
601
|
|
|
601
|
0
|
467
|
my $self = shift; |
34
|
601
|
|
|
|
|
468
|
my ($filter) = @_; |
35
|
|
|
|
|
|
|
|
36
|
601
|
50
|
|
|
|
804
|
return if $self->{+IS_ROOT}; |
37
|
|
|
|
|
|
|
|
38
|
601
|
|
|
|
|
893
|
my $result = $self->SUPER::filter($filter); |
39
|
|
|
|
|
|
|
|
40
|
601
|
|
|
|
|
459
|
my $child_ok = 0; |
41
|
601
|
|
|
|
|
405
|
for my $c (@{$self->{+PRIMARY}}) { |
|
601
|
|
|
|
|
797
|
|
42
|
894
|
100
|
|
|
|
1357
|
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
|
|
|
|
|
616
|
my $res = $c->filter($filter); |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
# A child satisfies the filter |
48
|
430
|
100
|
66
|
|
|
871
|
$child_ok++ if !$res || $res->{satisfied}; |
49
|
430
|
100
|
|
|
|
699
|
last if $child_ok; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
# If the filter says we are ok |
53
|
601
|
100
|
|
|
|
780
|
unless($result) { |
54
|
|
|
|
|
|
|
# If we are a variant then allow everything under us to be run |
55
|
78
|
100
|
100
|
|
|
343
|
return {satisfied => 1} if $self->{+VARIANT} || !$child_ok; |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
# Normal group |
58
|
8
|
|
|
|
|
14
|
return; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
523
|
100
|
|
|
|
723
|
return if $child_ok; |
62
|
|
|
|
|
|
|
|
63
|
457
|
|
|
|
|
467
|
return $result; |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
1; |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
__END__ |