line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Csistck::Role; |
2
|
|
|
|
|
|
|
|
3
|
17
|
|
|
17
|
|
686
|
use strict; |
|
17
|
|
|
|
|
61
|
|
|
17
|
|
|
|
|
563
|
|
4
|
17
|
|
|
17
|
|
89
|
use warnings; |
|
17
|
|
|
|
|
27
|
|
|
17
|
|
|
|
|
383
|
|
5
|
17
|
|
|
17
|
|
323
|
use 5.010; |
|
17
|
|
|
|
|
54
|
|
|
17
|
|
|
|
|
738
|
|
6
|
|
|
|
|
|
|
|
7
|
17
|
|
|
17
|
|
565
|
use Csistck; |
|
17
|
|
|
|
|
38
|
|
|
17
|
|
|
|
|
4980
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub new { |
11
|
1
|
|
|
1
|
0
|
332
|
my $class = shift; |
12
|
1
|
|
|
|
|
5
|
my %args = @_; |
13
|
1
|
|
|
|
|
3
|
my $args = \%args; |
14
|
|
|
|
|
|
|
|
15
|
1
|
|
|
|
|
4
|
my $self = {}; |
16
|
1
|
|
|
|
|
5
|
$self->{tests} = []; |
17
|
1
|
|
|
|
|
3
|
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
|
|
|
|
|
6
|
$self->defaults(); |
22
|
1
|
|
|
|
|
11
|
foreach my $key (keys (%{$args})) { |
|
1
|
|
|
|
|
8
|
|
23
|
1
|
50
|
|
|
|
7
|
$self->{$key} = $args->{$key} |
24
|
|
|
|
|
|
|
unless ($key =~ /^tests$/); |
25
|
|
|
|
|
|
|
} |
26
|
1
|
|
|
|
|
6
|
$self->tests(); |
27
|
|
|
|
|
|
|
|
28
|
1
|
|
|
|
|
5
|
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
|
3
|
my $self = shift; |
38
|
2
|
|
|
|
|
5
|
my @tests = @_; |
39
|
2
|
|
|
|
|
3
|
push(@{$self->{tests}}, @tests); |
|
2
|
|
|
|
|
7
|
|
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
# Return tests |
43
|
|
|
|
|
|
|
sub get_tests { |
44
|
2
|
|
|
2
|
0
|
466
|
my $self = shift; |
45
|
2
|
|
|
|
|
9
|
return $self->{tests}; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
1; |
49
|
|
|
|
|
|
|
__END__ |