line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test2::Workflow::Task::Group; |
2
|
46
|
|
|
46
|
|
95559
|
use strict; |
|
46
|
|
|
|
|
48
|
|
|
46
|
|
|
|
|
991
|
|
3
|
46
|
|
|
46
|
|
146
|
use warnings; |
|
46
|
|
|
|
|
47
|
|
|
46
|
|
|
|
|
1048
|
|
4
|
|
|
|
|
|
|
|
5
|
46
|
|
|
46
|
|
171
|
use Carp qw/croak/; |
|
46
|
|
|
|
|
46
|
|
|
46
|
|
|
|
|
1809
|
|
6
|
|
|
|
|
|
|
|
7
|
46
|
|
|
46
|
|
15880
|
use Test2::Workflow::Task::Action; |
|
46
|
|
|
|
|
72
|
|
|
46
|
|
|
|
|
972
|
|
8
|
|
|
|
|
|
|
|
9
|
46
|
|
|
46
|
|
206
|
use base 'Test2::Workflow::Task'; |
|
46
|
|
|
|
|
47
|
|
|
46
|
|
|
|
|
2694
|
|
10
|
46
|
|
|
46
|
|
180
|
use Test2::Util::HashBase qw/before after primary rand variant/; |
|
46
|
|
|
|
|
46
|
|
|
46
|
|
|
|
|
151
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub init { |
13
|
518
|
|
|
518
|
0
|
2976
|
my $self = shift; |
14
|
|
|
|
|
|
|
|
15
|
518
|
100
|
|
|
|
1066
|
if (my $take = delete $self->{take}) { |
16
|
375
|
|
|
|
|
1616
|
$self->{$_} = delete $take->{$_} for ISO, ASYNC, TODO, SKIP; |
17
|
375
|
|
|
|
|
1685
|
$self->{$_} = $take->{$_} for FLAT, SCAFFOLD, NAME, CODE, FRAME; |
18
|
375
|
|
|
|
|
350
|
$take->{+FLAT} = 1; |
19
|
375
|
|
|
|
|
343
|
$take->{+SCAFFOLD} = 1; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
{ |
23
|
518
|
|
|
|
|
390
|
local $Carp::CarpLevel = $Carp::CarpLevel + 1; |
|
518
|
|
|
|
|
561
|
|
24
|
518
|
|
|
|
|
961
|
$self->SUPER::init(); |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
518
|
|
50
|
|
|
798
|
$self->{+BEFORE} ||= []; |
28
|
518
|
|
50
|
|
|
721
|
$self->{+AFTER} ||= []; |
29
|
518
|
|
50
|
|
|
984
|
$self->{+PRIMARY} ||= []; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub filter { |
33
|
601
|
|
|
601
|
0
|
443
|
my $self = shift; |
34
|
601
|
|
|
|
|
451
|
my ($filter) = @_; |
35
|
|
|
|
|
|
|
|
36
|
601
|
50
|
|
|
|
735
|
return if $self->{+IS_ROOT}; |
37
|
|
|
|
|
|
|
|
38
|
601
|
|
|
|
|
889
|
my $result = $self->SUPER::filter($filter); |
39
|
|
|
|
|
|
|
|
40
|
601
|
|
|
|
|
438
|
my $child_ok = 0; |
41
|
601
|
|
|
|
|
372
|
for my $c (@{$self->{+PRIMARY}}) { |
|
601
|
|
|
|
|
730
|
|
42
|
894
|
100
|
|
|
|
1300
|
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
|
|
|
|
|
507
|
my $res = $c->filter($filter); |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
# A child satisfies the filter |
48
|
430
|
100
|
66
|
|
|
882
|
$child_ok++ if !$res || $res->{satisfied}; |
49
|
430
|
100
|
|
|
|
674
|
last if $child_ok; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
# If the filter says we are ok |
53
|
601
|
100
|
|
|
|
719
|
unless($result) { |
54
|
|
|
|
|
|
|
# If we are a variant then allow everything under us to be run |
55
|
78
|
100
|
100
|
|
|
302
|
return {satisfied => 1} if $self->{+VARIANT} || !$child_ok; |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
# Normal group |
58
|
8
|
|
|
|
|
12
|
return; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
523
|
100
|
|
|
|
642
|
return if $child_ok; |
62
|
|
|
|
|
|
|
|
63
|
457
|
|
|
|
|
447
|
return $result; |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
1; |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
__END__ |