line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test2::Workflow::Task::Group; |
2
|
47
|
|
|
47
|
|
332
|
use strict; |
|
47
|
|
|
|
|
152
|
|
|
47
|
|
|
|
|
1709
|
|
3
|
47
|
|
|
47
|
|
268
|
use warnings; |
|
47
|
|
|
|
|
107
|
|
|
47
|
|
|
|
|
2555
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.000155'; |
6
|
|
|
|
|
|
|
|
7
|
47
|
|
|
47
|
|
277
|
use Carp qw/croak/; |
|
47
|
|
|
|
|
89
|
|
|
47
|
|
|
|
|
2245
|
|
8
|
|
|
|
|
|
|
|
9
|
47
|
|
|
47
|
|
19396
|
use Test2::Workflow::Task::Action; |
|
47
|
|
|
|
|
194
|
|
|
47
|
|
|
|
|
1309
|
|
10
|
|
|
|
|
|
|
|
11
|
47
|
|
|
47
|
|
293
|
use base 'Test2::Workflow::Task'; |
|
47
|
|
|
|
|
113
|
|
|
47
|
|
|
|
|
4459
|
|
12
|
47
|
|
|
47
|
|
304
|
use Test2::Util::HashBase qw/before after primary rand variant/; |
|
47
|
|
|
|
|
111
|
|
|
47
|
|
|
|
|
210
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub init { |
15
|
520
|
|
|
520
|
0
|
7142
|
my $self = shift; |
16
|
|
|
|
|
|
|
|
17
|
520
|
100
|
|
|
|
1548
|
if (my $take = delete $self->{take}) { |
18
|
375
|
|
|
|
|
2318
|
$self->{$_} = delete $take->{$_} for ISO, ASYNC, TODO, SKIP; |
19
|
375
|
|
|
|
|
2649
|
$self->{$_} = $take->{$_} for FLAT, SCAFFOLD, NAME, CODE, FRAME; |
20
|
375
|
|
|
|
|
691
|
$take->{+FLAT} = 1; |
21
|
375
|
|
|
|
|
748
|
$take->{+SCAFFOLD} = 1; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
{ |
25
|
520
|
|
|
|
|
802
|
local $Carp::CarpLevel = $Carp::CarpLevel + 1; |
|
520
|
|
|
|
|
993
|
|
26
|
520
|
|
|
|
|
1343
|
$self->SUPER::init(); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
520
|
|
50
|
|
|
1481
|
$self->{+BEFORE} ||= []; |
30
|
520
|
|
50
|
|
|
1124
|
$self->{+AFTER} ||= []; |
31
|
520
|
|
50
|
|
|
1522
|
$self->{+PRIMARY} ||= []; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub filter { |
35
|
601
|
|
|
601
|
0
|
873
|
my $self = shift; |
36
|
601
|
|
|
|
|
981
|
my ($filter) = @_; |
37
|
|
|
|
|
|
|
|
38
|
601
|
50
|
|
|
|
1204
|
return if $self->{+IS_ROOT}; |
39
|
|
|
|
|
|
|
|
40
|
601
|
|
|
|
|
1286
|
my $result = $self->SUPER::filter($filter); |
41
|
|
|
|
|
|
|
|
42
|
601
|
|
|
|
|
994
|
my $child_ok = 0; |
43
|
601
|
|
|
|
|
790
|
for my $c (@{$self->{+PRIMARY}}) { |
|
601
|
|
|
|
|
1247
|
|
44
|
894
|
100
|
|
|
|
1970
|
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
|
|
|
|
|
819
|
my $res = $c->filter($filter); |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
# A child satisfies the filter |
50
|
430
|
100
|
100
|
|
|
1278
|
$child_ok++ if !$res || $res->{satisfied}; |
51
|
430
|
100
|
|
|
|
1017
|
last if $child_ok; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
# If the filter says we are ok |
55
|
601
|
100
|
|
|
|
1195
|
unless($result) { |
56
|
|
|
|
|
|
|
# If we are a variant then allow everything under us to be run |
57
|
78
|
100
|
100
|
|
|
379
|
return {satisfied => 1} if $self->{+VARIANT} || !$child_ok; |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
# Normal group |
60
|
8
|
|
|
|
|
26
|
return; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
523
|
100
|
|
|
|
1052
|
return if $child_ok; |
64
|
|
|
|
|
|
|
|
65
|
457
|
|
|
|
|
850
|
return $result; |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
1; |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
__END__ |