line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Workflow::Layer; |
2
|
137
|
|
|
137
|
|
709
|
use strict; |
|
137
|
|
|
|
|
233
|
|
|
137
|
|
|
|
|
3044
|
|
3
|
137
|
|
|
137
|
|
563
|
use warnings; |
|
137
|
|
|
|
|
268
|
|
|
137
|
|
|
|
|
2735
|
|
4
|
|
|
|
|
|
|
|
5
|
137
|
|
|
137
|
|
45429
|
use Test::Workflow::Block; |
|
137
|
|
|
|
|
379
|
|
|
137
|
|
|
|
|
3744
|
|
6
|
|
|
|
|
|
|
|
7
|
137
|
|
|
137
|
|
765
|
use Fennec::Util qw/accessors require_module/; |
|
137
|
|
|
|
|
363
|
|
|
137
|
|
|
|
|
513
|
|
8
|
137
|
|
|
137
|
|
39581
|
use Scalar::Util qw/blessed/; |
|
137
|
|
|
|
|
328
|
|
|
137
|
|
|
|
|
5899
|
|
9
|
137
|
|
|
137
|
|
873
|
use Carp qw/croak/; |
|
137
|
|
|
|
|
362
|
|
|
137
|
|
|
|
|
42885
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our @ATTRIBUTES = qw{ |
12
|
|
|
|
|
|
|
test |
13
|
|
|
|
|
|
|
case |
14
|
|
|
|
|
|
|
child |
15
|
|
|
|
|
|
|
before_case |
16
|
|
|
|
|
|
|
before_each |
17
|
|
|
|
|
|
|
before_all |
18
|
|
|
|
|
|
|
after_each |
19
|
|
|
|
|
|
|
after_all |
20
|
|
|
|
|
|
|
around_each |
21
|
|
|
|
|
|
|
around_all |
22
|
|
|
|
|
|
|
control |
23
|
|
|
|
|
|
|
}; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
accessors 'finalized', @ATTRIBUTES; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub new { |
28
|
338
|
|
|
338
|
0
|
825
|
bless( {map { ( $_ => [] ) } @ATTRIBUTES}, shift ); |
|
3718
|
|
|
|
|
6719
|
|
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub merge_in { |
32
|
3
|
|
|
3
|
0
|
8
|
my $self = shift; |
33
|
3
|
|
|
|
|
9
|
my ( $caller, @classes ) = @_; |
34
|
3
|
|
|
|
|
8
|
for my $class (@classes) { |
35
|
3
|
|
|
|
|
12
|
require_module $class; |
36
|
3
|
|
|
|
|
36
|
push @{$self->$_} => @{$class->TEST_WORKFLOW->root_layer->$_} for @ATTRIBUTES; |
|
33
|
|
|
|
|
76
|
|
|
33
|
|
|
|
|
60
|
|
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub add_control { |
41
|
10
|
|
|
10
|
0
|
20
|
my $self = shift; |
42
|
10
|
|
|
|
|
20
|
push @{$self->control} => @_; |
|
10
|
|
|
|
|
30
|
|
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub add_after_case { |
46
|
0
|
|
|
0
|
0
|
0
|
goto &before_each; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
for my $type (qw/test case child before_case before_each before_all around_each around_all/) { |
50
|
|
|
|
|
|
|
my $add = sub { |
51
|
1210
|
|
|
1210
|
|
1618
|
my $self = shift; |
52
|
1210
|
|
|
|
|
3162
|
my $block = Test::Workflow::Block->new(@_); |
53
|
1210
|
|
|
|
|
3036
|
$block->subtype($type); |
54
|
1210
|
|
|
|
|
1569
|
push @{$self->$type} => $block; |
|
1210
|
|
|
|
|
2687
|
|
55
|
|
|
|
|
|
|
}; |
56
|
137
|
|
|
137
|
|
847
|
no strict 'refs'; |
|
137
|
|
|
|
|
325
|
|
|
137
|
|
|
|
|
12787
|
|
57
|
|
|
|
|
|
|
*{"add_$type"} = $add; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
for my $type (qw/after_each after_all/) { |
61
|
|
|
|
|
|
|
my $add = sub { |
62
|
76
|
|
|
76
|
|
98
|
my $self = shift; |
63
|
76
|
|
|
|
|
156
|
my $block = Test::Workflow::Block->new(@_); |
64
|
76
|
|
|
|
|
219
|
$block->subtype($type); |
65
|
76
|
|
|
|
|
81
|
unshift @{$self->$type} => $block; |
|
76
|
|
|
|
|
174
|
|
66
|
|
|
|
|
|
|
}; |
67
|
137
|
|
|
137
|
|
871
|
no strict 'refs'; |
|
137
|
|
|
|
|
245
|
|
|
137
|
|
|
|
|
6682
|
|
68
|
|
|
|
|
|
|
*{"add_$type"} = $add; |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
1; |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
__END__ |