line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test2::Workflow::Task::Group; |
2
|
47
|
|
|
47
|
|
388
|
use strict; |
|
47
|
|
|
|
|
118
|
|
|
47
|
|
|
|
|
1352
|
|
3
|
47
|
|
|
47
|
|
267
|
use warnings; |
|
47
|
|
|
|
|
85
|
|
|
47
|
|
|
|
|
1812
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.000156'; |
6
|
|
|
|
|
|
|
|
7
|
47
|
|
|
47
|
|
238
|
use Carp qw/croak/; |
|
47
|
|
|
|
|
191
|
|
|
47
|
|
|
|
|
2014
|
|
8
|
|
|
|
|
|
|
|
9
|
47
|
|
|
47
|
|
20250
|
use Test2::Workflow::Task::Action; |
|
47
|
|
|
|
|
194
|
|
|
47
|
|
|
|
|
1340
|
|
10
|
|
|
|
|
|
|
|
11
|
47
|
|
|
47
|
|
305
|
use base 'Test2::Workflow::Task'; |
|
47
|
|
|
|
|
100
|
|
|
47
|
|
|
|
|
4352
|
|
12
|
47
|
|
|
47
|
|
342
|
use Test2::Util::HashBase qw/before after primary rand variant/; |
|
47
|
|
|
|
|
124
|
|
|
47
|
|
|
|
|
231
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub init { |
15
|
520
|
|
|
520
|
0
|
6439
|
my $self = shift; |
16
|
|
|
|
|
|
|
|
17
|
520
|
100
|
|
|
|
1452
|
if (my $take = delete $self->{take}) { |
18
|
375
|
|
|
|
|
2185
|
$self->{$_} = delete $take->{$_} for ISO, ASYNC, TODO, SKIP; |
19
|
375
|
|
|
|
|
2301
|
$self->{$_} = $take->{$_} for FLAT, SCAFFOLD, NAME, CODE, FRAME; |
20
|
375
|
|
|
|
|
644
|
$take->{+FLAT} = 1; |
21
|
375
|
|
|
|
|
523
|
$take->{+SCAFFOLD} = 1; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
{ |
25
|
520
|
|
|
|
|
768
|
local $Carp::CarpLevel = $Carp::CarpLevel + 1; |
|
520
|
|
|
|
|
867
|
|
26
|
520
|
|
|
|
|
1315
|
$self->SUPER::init(); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
520
|
|
50
|
|
|
1378
|
$self->{+BEFORE} ||= []; |
30
|
520
|
|
50
|
|
|
992
|
$self->{+AFTER} ||= []; |
31
|
520
|
|
50
|
|
|
1380
|
$self->{+PRIMARY} ||= []; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub filter { |
35
|
601
|
|
|
601
|
0
|
923
|
my $self = shift; |
36
|
601
|
|
|
|
|
987
|
my ($filter) = @_; |
37
|
|
|
|
|
|
|
|
38
|
601
|
50
|
|
|
|
1238
|
return if $self->{+IS_ROOT}; |
39
|
|
|
|
|
|
|
|
40
|
601
|
|
|
|
|
1381
|
my $result = $self->SUPER::filter($filter); |
41
|
|
|
|
|
|
|
|
42
|
601
|
|
|
|
|
986
|
my $child_ok = 0; |
43
|
601
|
|
|
|
|
766
|
for my $c (@{$self->{+PRIMARY}}) { |
|
601
|
|
|
|
|
1228
|
|
44
|
894
|
100
|
|
|
|
2129
|
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
|
|
|
|
|
835
|
my $res = $c->filter($filter); |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
# A child satisfies the filter |
50
|
430
|
100
|
100
|
|
|
1315
|
$child_ok++ if !$res || $res->{satisfied}; |
51
|
430
|
100
|
|
|
|
1003
|
last if $child_ok; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
# If the filter says we are ok |
55
|
601
|
100
|
|
|
|
1164
|
unless($result) { |
56
|
|
|
|
|
|
|
# If we are a variant then allow everything under us to be run |
57
|
78
|
100
|
100
|
|
|
407
|
return {satisfied => 1} if $self->{+VARIANT} || !$child_ok; |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
# Normal group |
60
|
8
|
|
|
|
|
19
|
return; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
523
|
100
|
|
|
|
1060
|
return if $child_ok; |
64
|
|
|
|
|
|
|
|
65
|
457
|
|
|
|
|
755
|
return $result; |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
1; |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
__END__ |