line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Csistck::Role; |
2
|
|
|
|
|
|
|
|
3
|
17
|
|
|
17
|
|
409
|
use strict; |
|
17
|
|
|
|
|
25
|
|
|
17
|
|
|
|
|
445
|
|
4
|
17
|
|
|
17
|
|
67
|
use warnings; |
|
17
|
|
|
|
|
22
|
|
|
17
|
|
|
|
|
381
|
|
5
|
17
|
|
|
17
|
|
260
|
use 5.010; |
|
17
|
|
|
|
|
45
|
|
6
|
|
|
|
|
|
|
|
7
|
17
|
|
|
17
|
|
366
|
use Csistck; |
|
17
|
|
|
|
|
46
|
|
|
17
|
|
|
|
|
4314
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub new { |
11
|
1
|
|
|
1
|
0
|
451
|
my $class = shift; |
12
|
1
|
|
|
|
|
3
|
my %args = @_; |
13
|
1
|
|
|
|
|
3
|
my $args = \%args; |
14
|
|
|
|
|
|
|
|
15
|
1
|
|
|
|
|
2
|
my $self = {}; |
16
|
1
|
|
|
|
|
3
|
$self->{tests} = []; |
17
|
1
|
|
|
|
|
2
|
bless($self, $class); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
# We won't add keys that overlap with required keys, |
20
|
|
|
|
|
|
|
# drop silently for now. Set up tests after |
21
|
1
|
|
|
|
|
4
|
$self->defaults(); |
22
|
1
|
|
|
|
|
7
|
foreach my $key (keys (%{$args})) { |
|
1
|
|
|
|
|
4
|
|
23
|
1
|
50
|
|
|
|
6
|
$self->{$key} = $args->{$key} |
24
|
|
|
|
|
|
|
unless ($key =~ /^tests$/); |
25
|
|
|
|
|
|
|
} |
26
|
1
|
|
|
|
|
3
|
$self->tests(); |
27
|
|
|
|
|
|
|
|
28
|
1
|
|
|
|
|
3
|
return $self; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
# For overriding |
32
|
0
|
|
|
0
|
1
|
0
|
sub defaults { return; }; |
33
|
0
|
|
|
0
|
1
|
0
|
sub tests { return; }; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
# Add test to object |
36
|
|
|
|
|
|
|
sub add { |
37
|
2
|
|
|
2
|
0
|
2
|
my $self = shift; |
38
|
2
|
|
|
|
|
4
|
my @tests = @_; |
39
|
2
|
|
|
|
|
1
|
push(@{$self->{tests}}, @tests); |
|
2
|
|
|
|
|
4
|
|
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
# Return tests |
43
|
|
|
|
|
|
|
sub get_tests { |
44
|
2
|
|
|
2
|
0
|
467
|
my $self = shift; |
45
|
2
|
|
|
|
|
7
|
return $self->{tests}; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
1; |
49
|
|
|
|
|
|
|
__END__ |