line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Count::Filter; |
2
|
|
|
|
|
|
|
$Test::Count::Filter::VERSION = '0.1104'; |
3
|
2
|
|
|
2
|
|
75527
|
use warnings; |
|
2
|
|
|
|
|
13
|
|
|
2
|
|
|
|
|
72
|
|
4
|
2
|
|
|
2
|
|
12
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
47
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
493
|
use parent 'Test::Count::Base'; |
|
2
|
|
|
|
|
383
|
|
|
2
|
|
|
|
|
13
|
|
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
553
|
use Test::Count (); |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
53
|
|
9
|
2
|
|
|
2
|
|
1035
|
use Test::Count::Lib (); |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
1178
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub _counter |
13
|
|
|
|
|
|
|
{ |
14
|
6
|
|
|
6
|
|
10
|
my $self = shift; |
15
|
6
|
100
|
|
|
|
15
|
if (@_) |
16
|
|
|
|
|
|
|
{ |
17
|
3
|
|
|
|
|
9
|
$self->{'_counter'} = shift; |
18
|
|
|
|
|
|
|
} |
19
|
6
|
|
|
|
|
15
|
return $self->{'_counter'}; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub _out_fh |
23
|
|
|
|
|
|
|
{ |
24
|
36
|
|
|
36
|
|
60
|
my $self = shift; |
25
|
36
|
100
|
|
|
|
73
|
if (@_) |
26
|
|
|
|
|
|
|
{ |
27
|
3
|
|
|
|
|
8
|
$self->{'_out_fh'} = shift; |
28
|
|
|
|
|
|
|
} |
29
|
36
|
|
|
|
|
132
|
return $self->{'_out_fh'}; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub _plan_prefix_regex |
33
|
|
|
|
|
|
|
{ |
34
|
6
|
|
|
6
|
|
11
|
my $self = shift; |
35
|
6
|
100
|
|
|
|
22
|
if (@_) |
36
|
|
|
|
|
|
|
{ |
37
|
3
|
|
|
|
|
12
|
$self->{'_plan_prefix_regex'} = shift; |
38
|
|
|
|
|
|
|
} |
39
|
6
|
|
|
|
|
18
|
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
|
|
|
|
|
7
|
my $args = shift; |
57
|
|
|
|
|
|
|
|
58
|
3
|
|
50
|
|
|
13
|
$args->{input_fh} ||= \*STDIN; |
59
|
3
|
|
50
|
|
|
152
|
$args->{output_fh} ||= \*STDOUT; |
60
|
3
|
|
66
|
|
|
36
|
$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
|
|
|
|
|
13
|
$self->_plan_prefix_regex( $args->{plan_prefix_regex} ); |
68
|
3
|
|
|
|
|
12
|
$self->_out_fh( $args->{output_fh} ); |
69
|
|
|
|
|
|
|
|
70
|
3
|
|
|
|
|
23
|
$self->_counter( Test::Count->new($args) ); |
71
|
|
|
|
|
|
|
|
72
|
3
|
|
|
|
|
6
|
return 0; |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
sub process |
77
|
|
|
|
|
|
|
{ |
78
|
3
|
|
|
3
|
1
|
17
|
my $self = shift; |
79
|
|
|
|
|
|
|
|
80
|
3
|
|
|
|
|
9
|
my $ret = $self->_counter()->process(); |
81
|
|
|
|
|
|
|
|
82
|
3
|
|
|
|
|
1670
|
my $count = $ret->{tests_count}; |
83
|
|
|
|
|
|
|
|
84
|
3
|
|
|
|
|
21
|
my $plan_re = $self->_plan_prefix_regex(); |
85
|
|
|
|
|
|
|
|
86
|
3
|
|
|
|
|
7
|
my @lines = @{ $ret->{lines} }; |
|
3
|
|
|
|
|
76
|
|
87
|
|
|
|
|
|
|
LINES_LOOP: |
88
|
3
|
|
|
|
|
16
|
while ( my $l = shift(@lines) ) |
89
|
|
|
|
|
|
|
{ |
90
|
30
|
100
|
|
|
|
578
|
if ( $l =~ s{^($plan_re)\d+}{$1$count} ) |
91
|
|
|
|
|
|
|
{ |
92
|
3
|
|
|
|
|
7
|
print { $self->_out_fh() } $l; |
|
3
|
|
|
|
|
14
|
|
93
|
3
|
|
|
|
|
41
|
last LINES_LOOP; |
94
|
|
|
|
|
|
|
} |
95
|
|
|
|
|
|
|
else |
96
|
|
|
|
|
|
|
{ |
97
|
27
|
|
|
|
|
45
|
print { $self->_out_fh() } $l; |
|
27
|
|
|
|
|
53
|
|
98
|
|
|
|
|
|
|
} |
99
|
|
|
|
|
|
|
} |
100
|
3
|
|
|
|
|
7
|
print { $self->_out_fh() } @lines; |
|
3
|
|
|
|
|
9
|
|
101
|
|
|
|
|
|
|
|
102
|
3
|
|
|
|
|
144
|
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__ |