line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Count::Filter; |
2
|
|
|
|
|
|
|
$Test::Count::Filter::VERSION = '0.1102'; |
3
|
2
|
|
|
2
|
|
55315
|
use warnings; |
|
2
|
|
|
|
|
13
|
|
|
2
|
|
|
|
|
59
|
|
4
|
2
|
|
|
2
|
|
10
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
41
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
377
|
use parent 'Test::Count::Base'; |
|
2
|
|
|
|
|
246
|
|
|
2
|
|
|
|
|
10
|
|
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
417
|
use Test::Count (); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
46
|
|
9
|
2
|
|
|
2
|
|
874
|
use Test::Count::Lib (); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
1000
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub _counter |
13
|
|
|
|
|
|
|
{ |
14
|
6
|
|
|
6
|
|
7
|
my $self = shift; |
15
|
6
|
100
|
|
|
|
13
|
if (@_) |
16
|
|
|
|
|
|
|
{ |
17
|
3
|
|
|
|
|
6
|
$self->{'_counter'} = shift; |
18
|
|
|
|
|
|
|
} |
19
|
6
|
|
|
|
|
14
|
return $self->{'_counter'}; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub _out_fh |
23
|
|
|
|
|
|
|
{ |
24
|
36
|
|
|
36
|
|
42
|
my $self = shift; |
25
|
36
|
100
|
|
|
|
59
|
if (@_) |
26
|
|
|
|
|
|
|
{ |
27
|
3
|
|
|
|
|
7
|
$self->{'_out_fh'} = shift; |
28
|
|
|
|
|
|
|
} |
29
|
36
|
|
|
|
|
100
|
return $self->{'_out_fh'}; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub _plan_prefix_regex |
33
|
|
|
|
|
|
|
{ |
34
|
6
|
|
|
6
|
|
10
|
my $self = shift; |
35
|
6
|
100
|
|
|
|
16
|
if (@_) |
36
|
|
|
|
|
|
|
{ |
37
|
3
|
|
|
|
|
10
|
$self->{'_plan_prefix_regex'} = shift; |
38
|
|
|
|
|
|
|
} |
39
|
6
|
|
|
|
|
12
|
return $self->{'_plan_prefix_regex'}; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub _assert_prefix_regex |
43
|
|
|
|
|
|
|
{ |
44
|
0
|
|
|
0
|
|
0
|
my $self = shift; |
45
|
0
|
0
|
|
|
|
0
|
if (@_) |
46
|
|
|
|
|
|
|
{ |
47
|
0
|
|
|
|
|
0
|
$self->{'_assert_prefix_regex'} = shift; |
48
|
|
|
|
|
|
|
} |
49
|
0
|
|
|
|
|
0
|
return $self->{'_assert_prefix_regex'}; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub _init |
54
|
|
|
|
|
|
|
{ |
55
|
3
|
|
|
3
|
|
6
|
my $self = shift; |
56
|
3
|
|
|
|
|
6
|
my $args = shift; |
57
|
|
|
|
|
|
|
|
58
|
3
|
|
50
|
|
|
11
|
$args->{input_fh} ||= \*STDIN; |
59
|
3
|
|
50
|
|
|
126
|
$args->{output_fh} ||= \*STDOUT; |
60
|
3
|
|
66
|
|
|
32
|
$args->{plan_prefix_regex} ||= Test::Count::Lib::perl_plan_prefix_regex(); |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
# Remmed out because Test::Count handles it by itself. |
63
|
|
|
|
|
|
|
# if (defined($args->{assert_prefix_regex})) |
64
|
|
|
|
|
|
|
# { |
65
|
|
|
|
|
|
|
# $self->_assert_prefix_regex($args->{assert_prefix_regex}); |
66
|
|
|
|
|
|
|
# } |
67
|
3
|
|
|
|
|
8
|
$self->_plan_prefix_regex( $args->{plan_prefix_regex} ); |
68
|
3
|
|
|
|
|
9
|
$self->_out_fh( $args->{output_fh} ); |
69
|
|
|
|
|
|
|
|
70
|
3
|
|
|
|
|
16
|
$self->_counter( Test::Count->new($args) ); |
71
|
|
|
|
|
|
|
|
72
|
3
|
|
|
|
|
5
|
return 0; |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
sub process |
77
|
|
|
|
|
|
|
{ |
78
|
3
|
|
|
3
|
1
|
12
|
my $self = shift; |
79
|
|
|
|
|
|
|
|
80
|
3
|
|
|
|
|
5
|
my $ret = $self->_counter()->process(); |
81
|
|
|
|
|
|
|
|
82
|
3
|
|
|
|
|
1157
|
my $count = $ret->{tests_count}; |
83
|
|
|
|
|
|
|
|
84
|
3
|
|
|
|
|
14
|
my $plan_re = $self->_plan_prefix_regex(); |
85
|
|
|
|
|
|
|
|
86
|
3
|
|
|
|
|
5
|
my @lines = @{ $ret->{lines} }; |
|
3
|
|
|
|
|
62
|
|
87
|
|
|
|
|
|
|
LINES_LOOP: |
88
|
3
|
|
|
|
|
13
|
while ( my $l = shift(@lines) ) |
89
|
|
|
|
|
|
|
{ |
90
|
30
|
100
|
|
|
|
394
|
if ( $l =~ s{^($plan_re)\d+}{$1$count} ) |
91
|
|
|
|
|
|
|
{ |
92
|
3
|
|
|
|
|
6
|
print { $self->_out_fh() } $l; |
|
3
|
|
|
|
|
8
|
|
93
|
3
|
|
|
|
|
32
|
last LINES_LOOP; |
94
|
|
|
|
|
|
|
} |
95
|
|
|
|
|
|
|
else |
96
|
|
|
|
|
|
|
{ |
97
|
27
|
|
|
|
|
31
|
print { $self->_out_fh() } $l; |
|
27
|
|
|
|
|
38
|
|
98
|
|
|
|
|
|
|
} |
99
|
|
|
|
|
|
|
} |
100
|
3
|
|
|
|
|
6
|
print { $self->_out_fh() } @lines; |
|
3
|
|
|
|
|
6
|
|
101
|
|
|
|
|
|
|
|
102
|
3
|
|
|
|
|
97
|
return 0; |
103
|
|
|
|
|
|
|
} |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
sub update_assignments |
107
|
|
|
|
|
|
|
{ |
108
|
0
|
|
|
0
|
1
|
|
my ( $self, $args ) = @_; |
109
|
|
|
|
|
|
|
|
110
|
0
|
|
|
|
|
|
return $self->_parser()->assignments( $args->{text} ); |
111
|
|
|
|
|
|
|
} |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
sub update_count |
115
|
|
|
|
|
|
|
{ |
116
|
0
|
|
|
0
|
1
|
|
my ( $self, $args ) = @_; |
117
|
|
|
|
|
|
|
|
118
|
0
|
|
|
|
|
|
return $self->_parser()->update_count( $args->{text} ); |
119
|
|
|
|
|
|
|
} |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
sub get_count |
123
|
|
|
|
|
|
|
{ |
124
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
125
|
|
|
|
|
|
|
|
126
|
0
|
|
|
|
|
|
return $self->_parser()->{count}; |
127
|
|
|
|
|
|
|
} |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
1; # End of Test::Count::Parser |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
__END__ |