| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Test::Count; |
|
2
|
|
|
|
|
|
|
$Test::Count::VERSION = '0.1102'; |
|
3
|
4
|
|
|
4
|
|
131246
|
use warnings; |
|
|
4
|
|
|
|
|
23
|
|
|
|
4
|
|
|
|
|
118
|
|
|
4
|
4
|
|
|
4
|
|
19
|
use strict; |
|
|
4
|
|
|
|
|
7
|
|
|
|
4
|
|
|
|
|
79
|
|
|
5
|
|
|
|
|
|
|
|
|
6
|
4
|
|
|
4
|
|
777
|
use parent 'Test::Count::Base'; |
|
|
4
|
|
|
|
|
528
|
|
|
|
4
|
|
|
|
|
17
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
4
|
|
|
4
|
|
1661
|
use Test::Count::Parser (); |
|
|
4
|
|
|
|
|
12
|
|
|
|
4
|
|
|
|
|
1903
|
|
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub _in_fh |
|
11
|
|
|
|
|
|
|
{ |
|
12
|
39
|
|
|
39
|
|
64
|
my $self = shift; |
|
13
|
39
|
100
|
|
|
|
88
|
if (@_) |
|
14
|
|
|
|
|
|
|
{ |
|
15
|
13
|
|
|
|
|
35
|
$self->{'_in_fh'} = shift; |
|
16
|
|
|
|
|
|
|
} |
|
17
|
39
|
|
|
|
|
833
|
return $self->{'_in_fh'}; |
|
18
|
|
|
|
|
|
|
} |
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub _assert_prefix_regex |
|
21
|
|
|
|
|
|
|
{ |
|
22
|
26
|
|
|
26
|
|
48
|
my $self = shift; |
|
23
|
26
|
100
|
|
|
|
67
|
if (@_) |
|
24
|
|
|
|
|
|
|
{ |
|
25
|
13
|
|
|
|
|
28
|
$self->{'_assert_prefix_regex'} = shift; |
|
26
|
|
|
|
|
|
|
} |
|
27
|
26
|
|
|
|
|
59
|
return $self->{'_assert_prefix_regex'}; |
|
28
|
|
|
|
|
|
|
} |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub _filename |
|
31
|
|
|
|
|
|
|
{ |
|
32
|
19
|
|
|
19
|
|
37
|
my $self = shift; |
|
33
|
19
|
100
|
|
|
|
62
|
if (@_) |
|
34
|
|
|
|
|
|
|
{ |
|
35
|
3
|
|
|
|
|
9
|
$self->{'_filename'} = shift; |
|
36
|
|
|
|
|
|
|
} |
|
37
|
19
|
|
|
|
|
183
|
return $self->{'_filename'}; |
|
38
|
|
|
|
|
|
|
} |
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub _init |
|
41
|
|
|
|
|
|
|
{ |
|
42
|
13
|
|
|
13
|
|
26
|
my $self = shift; |
|
43
|
13
|
|
|
|
|
23
|
my $args = shift; |
|
44
|
|
|
|
|
|
|
|
|
45
|
13
|
|
|
|
|
20
|
my $in; |
|
46
|
|
|
|
|
|
|
|
|
47
|
13
|
100
|
|
|
|
44
|
if ( exists( $args->{'filename'} ) ) |
|
48
|
|
|
|
|
|
|
{ |
|
49
|
3
|
|
|
|
|
13
|
$self->_filename( $args->{'filename'} ); |
|
50
|
3
|
50
|
|
|
|
18
|
open $in, "<", $self->_filename() |
|
51
|
|
|
|
|
|
|
or die "Could not open '" . $self->_filename() . "' - $!."; |
|
52
|
|
|
|
|
|
|
} |
|
53
|
|
|
|
|
|
|
else |
|
54
|
|
|
|
|
|
|
{ |
|
55
|
10
|
|
|
|
|
22
|
$in = $args->{'input_fh'}; |
|
56
|
|
|
|
|
|
|
} |
|
57
|
|
|
|
|
|
|
|
|
58
|
13
|
|
|
|
|
58
|
$self->_in_fh($in); |
|
59
|
13
|
100
|
|
|
|
33
|
if ( exists( $args->{'assert_prefix_regex'} ) ) |
|
60
|
|
|
|
|
|
|
{ |
|
61
|
1
|
|
|
|
|
3
|
my $re = $args->{'assert_prefix_regex'}; |
|
62
|
1
|
50
|
|
|
|
5
|
$self->_assert_prefix_regex( ( ref($re) eq "" ) ? qr{$re} : $re ); |
|
63
|
|
|
|
|
|
|
} |
|
64
|
|
|
|
|
|
|
else |
|
65
|
|
|
|
|
|
|
{ |
|
66
|
12
|
|
|
|
|
69
|
$self->_assert_prefix_regex(qr{# TEST}); |
|
67
|
|
|
|
|
|
|
} |
|
68
|
|
|
|
|
|
|
|
|
69
|
13
|
|
|
|
|
28
|
return 0; |
|
70
|
|
|
|
|
|
|
} |
|
71
|
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
sub process |
|
74
|
|
|
|
|
|
|
{ |
|
75
|
13
|
|
|
13
|
1
|
41
|
my $self = shift; |
|
76
|
13
|
|
|
|
|
21
|
my $args = shift; |
|
77
|
|
|
|
|
|
|
|
|
78
|
13
|
|
66
|
|
|
91
|
my $parser = $args->{parser} || Test::Count::Parser->new(); |
|
79
|
|
|
|
|
|
|
|
|
80
|
13
|
|
|
|
|
61
|
$parser->_push_current_filename( $self->_filename ); |
|
81
|
|
|
|
|
|
|
|
|
82
|
13
|
|
|
|
|
46
|
my $assert_re = $self->_assert_prefix_regex(); |
|
83
|
|
|
|
|
|
|
|
|
84
|
13
|
|
|
|
|
49
|
my @file_lines = readline( $self->_in_fh() ); |
|
85
|
13
|
|
|
|
|
2930
|
close( $self->_in_fh() ); |
|
86
|
|
|
|
|
|
|
|
|
87
|
13
|
|
|
|
|
111
|
foreach my $idx ( 0 .. $#file_lines ) |
|
88
|
|
|
|
|
|
|
{ |
|
89
|
453
|
|
|
|
|
175474
|
my $line = $file_lines[$idx]; |
|
90
|
|
|
|
|
|
|
|
|
91
|
453
|
|
|
|
|
527
|
chomp($line); |
|
92
|
453
|
100
|
|
|
|
1929
|
if ( $line =~ /${assert_re}:(.*)$/ ) |
|
|
|
100
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
{ |
|
94
|
28
|
|
|
|
|
151
|
$parser->update_assignments( |
|
95
|
|
|
|
|
|
|
{ |
|
96
|
|
|
|
|
|
|
'text' => $1, |
|
97
|
|
|
|
|
|
|
} |
|
98
|
|
|
|
|
|
|
); |
|
99
|
|
|
|
|
|
|
} |
|
100
|
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
# The \s* is to handle trailing whitespace properly. |
|
102
|
|
|
|
|
|
|
elsif ( $line =~ /${assert_re}((?:[+*].*)?)\s*$/ ) |
|
103
|
|
|
|
|
|
|
{ |
|
104
|
40
|
|
|
|
|
100
|
my $s = $1; |
|
105
|
40
|
100
|
|
|
|
211
|
$parser->update_count( |
|
106
|
|
|
|
|
|
|
{ |
|
107
|
|
|
|
|
|
|
'text' => ( ( $s eq "" ) ? 1 : substr( $s, 1 ) ), |
|
108
|
|
|
|
|
|
|
} |
|
109
|
|
|
|
|
|
|
); |
|
110
|
|
|
|
|
|
|
} |
|
111
|
|
|
|
|
|
|
} |
|
112
|
13
|
|
|
|
|
75
|
$parser->_pop_current_filenames(); |
|
113
|
13
|
50
|
|
|
|
20
|
if ( @{ $parser->_parser->{filter_mults} } != 1 ) |
|
|
13
|
|
|
|
|
43
|
|
|
114
|
|
|
|
|
|
|
{ |
|
115
|
0
|
|
|
|
|
0
|
die "Unbalanced FILTER() and ENDFILTER()."; |
|
116
|
|
|
|
|
|
|
} |
|
117
|
|
|
|
|
|
|
|
|
118
|
13
|
|
|
|
|
54
|
return { 'tests_count' => $parser->get_count(), 'lines' => \@file_lines, }; |
|
119
|
|
|
|
|
|
|
} |
|
120
|
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
1; # End of Test::Count |
|
123
|
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
__END__ |