line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Ika::Reporter::Test; |
2
|
13
|
|
|
13
|
|
9172
|
use strict; |
|
13
|
|
|
|
|
24
|
|
|
13
|
|
|
|
|
404
|
|
3
|
13
|
|
|
13
|
|
64
|
use warnings; |
|
13
|
|
|
|
|
20
|
|
|
13
|
|
|
|
|
275
|
|
4
|
13
|
|
|
13
|
|
62
|
use utf8; |
|
13
|
|
|
|
|
22
|
|
|
13
|
|
|
|
|
62
|
|
5
|
13
|
|
|
13
|
|
230
|
use Scope::Guard; |
|
13
|
|
|
|
|
20
|
|
|
13
|
|
|
|
|
4647
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub new { |
8
|
12
|
|
|
12
|
0
|
173
|
my $class = shift; |
9
|
12
|
|
|
|
|
113
|
return bless { |
10
|
|
|
|
|
|
|
describe => [], |
11
|
|
|
|
|
|
|
report => [], |
12
|
|
|
|
|
|
|
}, $class; |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
18
|
|
|
18
|
0
|
6503
|
sub report { $_[0]->{report} } |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub describe { |
18
|
25
|
|
|
25
|
0
|
45
|
my ($self, $name) = @_; |
19
|
|
|
|
|
|
|
|
20
|
25
|
|
|
|
|
175
|
push @{$self->{describe}}, $name; |
|
25
|
|
|
|
|
142
|
|
21
|
|
|
|
|
|
|
return Scope::Guard->new(sub { |
22
|
25
|
|
|
25
|
|
254
|
pop @{$self->{describe}}; |
|
25
|
|
|
|
|
153
|
|
23
|
25
|
|
|
|
|
589
|
}); |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub exception { |
27
|
0
|
|
|
0
|
0
|
0
|
my ($self, $name) = @_; |
28
|
0
|
|
|
|
|
0
|
$name =~ s/\n\Z//; |
29
|
|
|
|
|
|
|
|
30
|
0
|
|
|
|
|
0
|
push @{$self->{report}}, [exception => $name]; |
|
0
|
|
|
|
|
0
|
|
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub it { |
34
|
41
|
|
|
41
|
0
|
69
|
my ($self, $name, $test) = @_; |
35
|
|
|
|
|
|
|
|
36
|
41
|
|
|
|
|
50
|
push @{$self->{report}}, ['it', $name, $test, [@{$self->{describe}}]]; |
|
41
|
|
|
|
|
86
|
|
|
41
|
|
|
|
|
206
|
|
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub finalize { |
40
|
12
|
|
|
12
|
0
|
30
|
my $self = shift; |
41
|
12
|
50
|
|
|
|
78
|
if ($self->{finalized}++) { |
42
|
0
|
|
|
|
|
|
Carp::croak("Do not finalize twice."); |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
1; |
47
|
|
|
|
|
|
|
__END__ |