| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package TAP::Parser::Aggregator; |
|
2
|
|
|
|
|
|
|
|
|
3
|
19
|
|
|
19
|
|
5682
|
use strict; |
|
|
19
|
|
|
|
|
51
|
|
|
|
19
|
|
|
|
|
622
|
|
|
4
|
19
|
|
|
19
|
|
131
|
use warnings; |
|
|
19
|
|
|
|
|
45
|
|
|
|
19
|
|
|
|
|
690
|
|
|
5
|
19
|
|
|
19
|
|
11604
|
use Benchmark; |
|
|
19
|
|
|
|
|
96176
|
|
|
|
19
|
|
|
|
|
174
|
|
|
6
|
|
|
|
|
|
|
|
|
7
|
19
|
|
|
19
|
|
3026
|
use base 'TAP::Object'; |
|
|
19
|
|
|
|
|
59
|
|
|
|
19
|
|
|
|
|
3653
|
|
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 NAME |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
TAP::Parser::Aggregator - Aggregate TAP::Parser results |
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 VERSION |
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
Version 3.40_01 |
|
16
|
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=cut |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
our $VERSION = '3.40_01'; |
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
use TAP::Parser::Aggregator; |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
my $aggregate = TAP::Parser::Aggregator->new; |
|
26
|
|
|
|
|
|
|
$aggregate->add( 't/00-load.t', $load_parser ); |
|
27
|
|
|
|
|
|
|
$aggregate->add( 't/10-lex.t', $lex_parser ); |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
my $summary = <<'END_SUMMARY'; |
|
30
|
|
|
|
|
|
|
Passed: %s |
|
31
|
|
|
|
|
|
|
Failed: %s |
|
32
|
|
|
|
|
|
|
Unexpectedly succeeded: %s |
|
33
|
|
|
|
|
|
|
END_SUMMARY |
|
34
|
|
|
|
|
|
|
printf $summary, |
|
35
|
|
|
|
|
|
|
scalar $aggregate->passed, |
|
36
|
|
|
|
|
|
|
scalar $aggregate->failed, |
|
37
|
|
|
|
|
|
|
scalar $aggregate->todo_passed; |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
C collects parser objects and allows |
|
42
|
|
|
|
|
|
|
reporting/querying their aggregate results. |
|
43
|
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head1 METHODS |
|
45
|
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head2 Class Methods |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head3 C |
|
49
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
my $aggregate = TAP::Parser::Aggregator->new; |
|
51
|
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
Returns a new C object. |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=cut |
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
# new() implementation supplied by TAP::Object |
|
57
|
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
my %SUMMARY_METHOD_FOR; |
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
BEGIN { # install summary methods |
|
61
|
19
|
|
|
19
|
|
88
|
%SUMMARY_METHOD_FOR = map { $_ => $_ } qw( |
|
|
171
|
|
|
|
|
519
|
|
|
62
|
|
|
|
|
|
|
failed |
|
63
|
|
|
|
|
|
|
parse_errors |
|
64
|
|
|
|
|
|
|
passed |
|
65
|
|
|
|
|
|
|
skipped |
|
66
|
|
|
|
|
|
|
todo |
|
67
|
|
|
|
|
|
|
todo_passed |
|
68
|
|
|
|
|
|
|
total |
|
69
|
|
|
|
|
|
|
wait |
|
70
|
|
|
|
|
|
|
exit |
|
71
|
|
|
|
|
|
|
); |
|
72
|
19
|
|
|
|
|
84
|
$SUMMARY_METHOD_FOR{total} = 'tests_run'; |
|
73
|
19
|
|
|
|
|
57
|
$SUMMARY_METHOD_FOR{planned} = 'tests_planned'; |
|
74
|
|
|
|
|
|
|
|
|
75
|
19
|
|
|
|
|
95
|
for my $method ( keys %SUMMARY_METHOD_FOR ) { |
|
76
|
190
|
100
|
|
|
|
1571
|
next if 'total' eq $method; |
|
77
|
19
|
|
|
19
|
|
159
|
no strict 'refs'; |
|
|
19
|
|
|
|
|
52
|
|
|
|
19
|
|
|
|
|
1868
|
|
|
78
|
|
|
|
|
|
|
*$method = sub { |
|
79
|
528
|
|
|
528
|
|
1163
|
my $self = shift; |
|
80
|
|
|
|
|
|
|
return wantarray |
|
81
|
8
|
|
|
|
|
56
|
? @{ $self->{"descriptions_for_$method"} } |
|
82
|
528
|
100
|
|
|
|
4279
|
: $self->{$method}; |
|
83
|
171
|
|
|
|
|
17552
|
}; |
|
84
|
|
|
|
|
|
|
} |
|
85
|
|
|
|
|
|
|
} # end install summary methods |
|
86
|
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
sub _initialize { |
|
88
|
84
|
|
|
84
|
|
288
|
my ($self) = @_; |
|
89
|
84
|
|
|
|
|
469
|
$self->{parser_for} = {}; |
|
90
|
84
|
|
|
|
|
323
|
$self->{parse_order} = []; |
|
91
|
84
|
|
|
|
|
607
|
for my $summary ( keys %SUMMARY_METHOD_FOR ) { |
|
92
|
840
|
|
|
|
|
2129
|
$self->{$summary} = 0; |
|
93
|
840
|
100
|
|
|
|
2075
|
next if 'total' eq $summary; |
|
94
|
756
|
|
|
|
|
2729
|
$self->{"descriptions_for_$summary"} = []; |
|
95
|
|
|
|
|
|
|
} |
|
96
|
84
|
|
|
|
|
655
|
return $self; |
|
97
|
|
|
|
|
|
|
} |
|
98
|
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
############################################################################## |
|
100
|
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=head2 Instance Methods |
|
102
|
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=head3 C |
|
104
|
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
$aggregate->add( $description => $parser ); |
|
106
|
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
The C<$description> is usually a test file name (but only by |
|
108
|
|
|
|
|
|
|
convention.) It is used as a unique identifier (see e.g. |
|
109
|
|
|
|
|
|
|
L<"parsers">.) Reusing a description is a fatal error. |
|
110
|
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
The C<$parser> is a L object. |
|
112
|
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
=cut |
|
114
|
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
sub add { |
|
116
|
112
|
|
|
112
|
1
|
1609
|
my ( $self, $description, $parser ) = @_; |
|
117
|
112
|
100
|
|
|
|
726
|
if ( exists $self->{parser_for}{$description} ) { |
|
118
|
1
|
|
|
|
|
11
|
$self->_croak( "You already have a parser for ($description)." |
|
119
|
|
|
|
|
|
|
. " Perhaps you have run the same test twice." ); |
|
120
|
|
|
|
|
|
|
} |
|
121
|
111
|
|
|
|
|
301
|
push @{ $self->{parse_order} } => $description; |
|
|
111
|
|
|
|
|
690
|
|
|
122
|
111
|
|
|
|
|
712
|
$self->{parser_for}{$description} = $parser; |
|
123
|
|
|
|
|
|
|
|
|
124
|
111
|
|
|
|
|
1229
|
while ( my ( $summary, $method ) = each %SUMMARY_METHOD_FOR ) { |
|
125
|
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
# Slightly nasty. Instead we should maybe have 'cooked' accessors |
|
127
|
|
|
|
|
|
|
# for results that may be masked by the parser. |
|
128
|
|
|
|
|
|
|
next |
|
129
|
1110
|
50
|
100
|
|
|
6401
|
if ( $method eq 'exit' || $method eq 'wait' ) |
|
|
|
|
66
|
|
|
|
|
|
130
|
|
|
|
|
|
|
&& $parser->ignore_exit; |
|
131
|
|
|
|
|
|
|
|
|
132
|
1110
|
100
|
|
|
|
4987
|
if ( my $count = $parser->$method() ) { |
|
133
|
383
|
|
|
|
|
1196
|
$self->{$summary} += $count; |
|
134
|
383
|
|
|
|
|
785
|
push @{ $self->{"descriptions_for_$summary"} } => $description; |
|
|
383
|
|
|
|
|
3982
|
|
|
135
|
|
|
|
|
|
|
} |
|
136
|
|
|
|
|
|
|
} |
|
137
|
|
|
|
|
|
|
|
|
138
|
111
|
|
|
|
|
636
|
return $self; |
|
139
|
|
|
|
|
|
|
} |
|
140
|
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
############################################################################## |
|
142
|
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
=head3 C |
|
144
|
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
my $count = $aggregate->parsers; |
|
146
|
|
|
|
|
|
|
my @parsers = $aggregate->parsers; |
|
147
|
|
|
|
|
|
|
my @parsers = $aggregate->parsers(@descriptions); |
|
148
|
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
In scalar context without arguments, this method returns the number of parsers |
|
150
|
|
|
|
|
|
|
aggregated. In list context without arguments, returns the parsers in the |
|
151
|
|
|
|
|
|
|
order they were added. |
|
152
|
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
If C<@descriptions> is given, these correspond to the keys used in each |
|
154
|
|
|
|
|
|
|
call to the add() method. Returns an array of the requested parsers (in |
|
155
|
|
|
|
|
|
|
the requested order) in list context or an array reference in scalar |
|
156
|
|
|
|
|
|
|
context. |
|
157
|
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
Requesting an unknown identifier is a fatal error. |
|
159
|
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
=cut |
|
161
|
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
sub parsers { |
|
163
|
79
|
|
|
79
|
1
|
1555
|
my $self = shift; |
|
164
|
79
|
100
|
|
|
|
564
|
return $self->_get_parsers(@_) if @_; |
|
165
|
4
|
|
|
|
|
13
|
my $descriptions = $self->{parse_order}; |
|
166
|
4
|
|
|
|
|
13
|
my @parsers = @{ $self->{parser_for} }{@$descriptions}; |
|
|
4
|
|
|
|
|
18
|
|
|
167
|
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
# Note: Because of the way context works, we must assign the parsers to |
|
169
|
|
|
|
|
|
|
# the @parsers array or else this method does not work as documented. |
|
170
|
4
|
|
|
|
|
25
|
return @parsers; |
|
171
|
|
|
|
|
|
|
} |
|
172
|
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
sub _get_parsers { |
|
174
|
77
|
|
|
77
|
|
3082
|
my ( $self, @descriptions ) = @_; |
|
175
|
77
|
|
|
|
|
171
|
my @parsers; |
|
176
|
77
|
|
|
|
|
294
|
for my $description (@descriptions) { |
|
177
|
|
|
|
|
|
|
$self->_croak("A parser for ($description) could not be found") |
|
178
|
79
|
100
|
|
|
|
349
|
unless exists $self->{parser_for}{$description}; |
|
179
|
78
|
|
|
|
|
330
|
push @parsers => $self->{parser_for}{$description}; |
|
180
|
|
|
|
|
|
|
} |
|
181
|
76
|
100
|
|
|
|
435
|
return wantarray ? @parsers : \@parsers; |
|
182
|
|
|
|
|
|
|
} |
|
183
|
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
=head3 C |
|
185
|
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
Get an array of descriptions in the order in which they were added to |
|
187
|
|
|
|
|
|
|
the aggregator. |
|
188
|
|
|
|
|
|
|
|
|
189
|
|
|
|
|
|
|
=cut |
|
190
|
|
|
|
|
|
|
|
|
191
|
71
|
50
|
|
71
|
1
|
1126
|
sub descriptions { @{ shift->{parse_order} || [] } } |
|
|
71
|
|
|
|
|
556
|
|
|
192
|
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
=head3 C |
|
194
|
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
Call C immediately before adding any results to the aggregator. |
|
196
|
|
|
|
|
|
|
Among other times it records the start time for the test run. |
|
197
|
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
=cut |
|
199
|
|
|
|
|
|
|
|
|
200
|
|
|
|
|
|
|
sub start { |
|
201
|
79
|
|
|
79
|
1
|
371
|
my $self = shift; |
|
202
|
79
|
|
|
|
|
582
|
$self->{start_time} = Benchmark->new; |
|
203
|
|
|
|
|
|
|
} |
|
204
|
|
|
|
|
|
|
|
|
205
|
|
|
|
|
|
|
=head3 C |
|
206
|
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
Call C immediately after adding all test results to the aggregator. |
|
208
|
|
|
|
|
|
|
|
|
209
|
|
|
|
|
|
|
=cut |
|
210
|
|
|
|
|
|
|
|
|
211
|
|
|
|
|
|
|
sub stop { |
|
212
|
77
|
|
|
77
|
1
|
251
|
my $self = shift; |
|
213
|
77
|
|
|
|
|
1053
|
$self->{end_time} = Benchmark->new; |
|
214
|
|
|
|
|
|
|
} |
|
215
|
|
|
|
|
|
|
|
|
216
|
|
|
|
|
|
|
=head3 C |
|
217
|
|
|
|
|
|
|
|
|
218
|
|
|
|
|
|
|
Elapsed returns a L object that represents the running time |
|
219
|
|
|
|
|
|
|
of the aggregated tests. In order for C to be valid you must |
|
220
|
|
|
|
|
|
|
call C before running the tests and C immediately |
|
221
|
|
|
|
|
|
|
afterwards. |
|
222
|
|
|
|
|
|
|
|
|
223
|
|
|
|
|
|
|
=cut |
|
224
|
|
|
|
|
|
|
|
|
225
|
|
|
|
|
|
|
sub elapsed { |
|
226
|
71
|
|
|
71
|
1
|
229
|
my $self = shift; |
|
227
|
|
|
|
|
|
|
|
|
228
|
71
|
|
|
|
|
1063
|
require Carp; |
|
229
|
|
|
|
|
|
|
Carp::croak |
|
230
|
|
|
|
|
|
|
q{Can't call elapsed without first calling start and then stop} |
|
231
|
71
|
50
|
33
|
|
|
662
|
unless defined $self->{start_time} && defined $self->{end_time}; |
|
232
|
71
|
|
|
|
|
499
|
return timediff( $self->{end_time}, $self->{start_time} ); |
|
233
|
|
|
|
|
|
|
} |
|
234
|
|
|
|
|
|
|
|
|
235
|
|
|
|
|
|
|
=head3 C |
|
236
|
|
|
|
|
|
|
|
|
237
|
|
|
|
|
|
|
Returns a formatted string representing the runtime returned by |
|
238
|
|
|
|
|
|
|
C. This lets the caller not worry about Benchmark. |
|
239
|
|
|
|
|
|
|
|
|
240
|
|
|
|
|
|
|
=cut |
|
241
|
|
|
|
|
|
|
|
|
242
|
|
|
|
|
|
|
sub elapsed_timestr { |
|
243
|
38
|
|
|
38
|
1
|
102
|
my $self = shift; |
|
244
|
|
|
|
|
|
|
|
|
245
|
38
|
|
|
|
|
373
|
my $elapsed = $self->elapsed; |
|
246
|
|
|
|
|
|
|
|
|
247
|
38
|
|
|
|
|
2125
|
return timestr($elapsed); |
|
248
|
|
|
|
|
|
|
} |
|
249
|
|
|
|
|
|
|
|
|
250
|
|
|
|
|
|
|
=head3 C |
|
251
|
|
|
|
|
|
|
|
|
252
|
|
|
|
|
|
|
Return true if all the tests passed and no parse errors were detected. |
|
253
|
|
|
|
|
|
|
|
|
254
|
|
|
|
|
|
|
=cut |
|
255
|
|
|
|
|
|
|
|
|
256
|
|
|
|
|
|
|
sub all_passed { |
|
257
|
40
|
|
|
40
|
1
|
108
|
my $self = shift; |
|
258
|
|
|
|
|
|
|
return |
|
259
|
40
|
|
66
|
|
|
134
|
$self->total |
|
260
|
|
|
|
|
|
|
&& $self->total == $self->passed |
|
261
|
|
|
|
|
|
|
&& !$self->has_errors; |
|
262
|
|
|
|
|
|
|
} |
|
263
|
|
|
|
|
|
|
|
|
264
|
|
|
|
|
|
|
=head3 C |
|
265
|
|
|
|
|
|
|
|
|
266
|
|
|
|
|
|
|
Get a single word describing the status of the aggregated tests. |
|
267
|
|
|
|
|
|
|
Depending on the outcome of the tests returns 'PASS', 'FAIL' or |
|
268
|
|
|
|
|
|
|
'NOTESTS'. This token is understood by L. |
|
269
|
|
|
|
|
|
|
|
|
270
|
|
|
|
|
|
|
=cut |
|
271
|
|
|
|
|
|
|
|
|
272
|
|
|
|
|
|
|
sub get_status { |
|
273
|
40
|
|
|
40
|
1
|
123
|
my $self = shift; |
|
274
|
|
|
|
|
|
|
|
|
275
|
40
|
|
|
|
|
195
|
my $total = $self->total; |
|
276
|
40
|
|
|
|
|
198
|
my $passed = $self->passed; |
|
277
|
|
|
|
|
|
|
|
|
278
|
|
|
|
|
|
|
return |
|
279
|
40
|
50
|
66
|
|
|
178
|
( $self->has_errors || $total != $passed ) ? 'FAIL' |
|
|
|
100
|
|
|
|
|
|
|
280
|
|
|
|
|
|
|
: $total ? 'PASS' |
|
281
|
|
|
|
|
|
|
: 'NOTESTS'; |
|
282
|
|
|
|
|
|
|
} |
|
283
|
|
|
|
|
|
|
|
|
284
|
|
|
|
|
|
|
############################################################################## |
|
285
|
|
|
|
|
|
|
|
|
286
|
|
|
|
|
|
|
=head2 Summary methods |
|
287
|
|
|
|
|
|
|
|
|
288
|
|
|
|
|
|
|
Each of the following methods will return the total number of corresponding |
|
289
|
|
|
|
|
|
|
tests if called in scalar context. If called in list context, returns the |
|
290
|
|
|
|
|
|
|
descriptions of the parsers which contain the corresponding tests (see C |
|
291
|
|
|
|
|
|
|
for an explanation of description. |
|
292
|
|
|
|
|
|
|
|
|
293
|
|
|
|
|
|
|
=over 4 |
|
294
|
|
|
|
|
|
|
|
|
295
|
|
|
|
|
|
|
=item * failed |
|
296
|
|
|
|
|
|
|
|
|
297
|
|
|
|
|
|
|
=item * parse_errors |
|
298
|
|
|
|
|
|
|
|
|
299
|
|
|
|
|
|
|
=item * passed |
|
300
|
|
|
|
|
|
|
|
|
301
|
|
|
|
|
|
|
=item * planned |
|
302
|
|
|
|
|
|
|
|
|
303
|
|
|
|
|
|
|
=item * skipped |
|
304
|
|
|
|
|
|
|
|
|
305
|
|
|
|
|
|
|
=item * todo |
|
306
|
|
|
|
|
|
|
|
|
307
|
|
|
|
|
|
|
=item * todo_passed |
|
308
|
|
|
|
|
|
|
|
|
309
|
|
|
|
|
|
|
=item * wait |
|
310
|
|
|
|
|
|
|
|
|
311
|
|
|
|
|
|
|
=item * exit |
|
312
|
|
|
|
|
|
|
|
|
313
|
|
|
|
|
|
|
=back |
|
314
|
|
|
|
|
|
|
|
|
315
|
|
|
|
|
|
|
For example, to find out how many tests unexpectedly succeeded (TODO tests |
|
316
|
|
|
|
|
|
|
which passed when they shouldn't): |
|
317
|
|
|
|
|
|
|
|
|
318
|
|
|
|
|
|
|
my $count = $aggregate->todo_passed; |
|
319
|
|
|
|
|
|
|
my @descriptions = $aggregate->todo_passed; |
|
320
|
|
|
|
|
|
|
|
|
321
|
|
|
|
|
|
|
Note that C and C are the totals of the wait and exit |
|
322
|
|
|
|
|
|
|
statuses of each of the tests. These values are totalled only to provide |
|
323
|
|
|
|
|
|
|
a true value if any of them are non-zero. |
|
324
|
|
|
|
|
|
|
|
|
325
|
|
|
|
|
|
|
=cut |
|
326
|
|
|
|
|
|
|
|
|
327
|
|
|
|
|
|
|
############################################################################## |
|
328
|
|
|
|
|
|
|
|
|
329
|
|
|
|
|
|
|
=head3 C |
|
330
|
|
|
|
|
|
|
|
|
331
|
|
|
|
|
|
|
my $tests_run = $aggregate->total; |
|
332
|
|
|
|
|
|
|
|
|
333
|
|
|
|
|
|
|
Returns the total number of tests run. |
|
334
|
|
|
|
|
|
|
|
|
335
|
|
|
|
|
|
|
=cut |
|
336
|
|
|
|
|
|
|
|
|
337
|
161
|
|
|
161
|
1
|
946
|
sub total { shift->{total} } |
|
338
|
|
|
|
|
|
|
|
|
339
|
|
|
|
|
|
|
############################################################################## |
|
340
|
|
|
|
|
|
|
|
|
341
|
|
|
|
|
|
|
=head3 C |
|
342
|
|
|
|
|
|
|
|
|
343
|
|
|
|
|
|
|
if ( $parser->has_problems ) { |
|
344
|
|
|
|
|
|
|
... |
|
345
|
|
|
|
|
|
|
} |
|
346
|
|
|
|
|
|
|
|
|
347
|
|
|
|
|
|
|
Identical to C, but also returns true if any TODO tests |
|
348
|
|
|
|
|
|
|
unexpectedly succeeded. This is more akin to "warnings". |
|
349
|
|
|
|
|
|
|
|
|
350
|
|
|
|
|
|
|
=cut |
|
351
|
|
|
|
|
|
|
|
|
352
|
|
|
|
|
|
|
sub has_problems { |
|
353
|
31
|
|
|
31
|
1
|
3567
|
my $self = shift; |
|
354
|
31
|
|
100
|
|
|
127
|
return $self->todo_passed |
|
355
|
|
|
|
|
|
|
|| $self->has_errors; |
|
356
|
|
|
|
|
|
|
} |
|
357
|
|
|
|
|
|
|
|
|
358
|
|
|
|
|
|
|
############################################################################## |
|
359
|
|
|
|
|
|
|
|
|
360
|
|
|
|
|
|
|
=head3 C |
|
361
|
|
|
|
|
|
|
|
|
362
|
|
|
|
|
|
|
if ( $parser->has_errors ) { |
|
363
|
|
|
|
|
|
|
... |
|
364
|
|
|
|
|
|
|
} |
|
365
|
|
|
|
|
|
|
|
|
366
|
|
|
|
|
|
|
Returns true if I of the parsers failed. This includes: |
|
367
|
|
|
|
|
|
|
|
|
368
|
|
|
|
|
|
|
=over 4 |
|
369
|
|
|
|
|
|
|
|
|
370
|
|
|
|
|
|
|
=item * Failed tests |
|
371
|
|
|
|
|
|
|
|
|
372
|
|
|
|
|
|
|
=item * Parse errors |
|
373
|
|
|
|
|
|
|
|
|
374
|
|
|
|
|
|
|
=item * Bad exit or wait status |
|
375
|
|
|
|
|
|
|
|
|
376
|
|
|
|
|
|
|
=back |
|
377
|
|
|
|
|
|
|
|
|
378
|
|
|
|
|
|
|
=cut |
|
379
|
|
|
|
|
|
|
|
|
380
|
|
|
|
|
|
|
sub has_errors { |
|
381
|
98
|
|
|
98
|
1
|
242
|
my $self = shift; |
|
382
|
|
|
|
|
|
|
return |
|
383
|
98
|
|
100
|
|
|
318
|
$self->failed |
|
384
|
|
|
|
|
|
|
|| $self->parse_errors |
|
385
|
|
|
|
|
|
|
|| $self->exit |
|
386
|
|
|
|
|
|
|
|| $self->wait; |
|
387
|
|
|
|
|
|
|
} |
|
388
|
|
|
|
|
|
|
|
|
389
|
|
|
|
|
|
|
############################################################################## |
|
390
|
|
|
|
|
|
|
|
|
391
|
|
|
|
|
|
|
=head3 C |
|
392
|
|
|
|
|
|
|
|
|
393
|
|
|
|
|
|
|
# deprecated in favor of 'todo_passed'. This method was horribly misnamed. |
|
394
|
|
|
|
|
|
|
|
|
395
|
|
|
|
|
|
|
This was a badly misnamed method. It indicates which TODO tests unexpectedly |
|
396
|
|
|
|
|
|
|
succeeded. Will now issue a warning and call C. |
|
397
|
|
|
|
|
|
|
|
|
398
|
|
|
|
|
|
|
=cut |
|
399
|
|
|
|
|
|
|
|
|
400
|
|
|
|
|
|
|
sub todo_failed { |
|
401
|
1
|
|
|
1
|
1
|
2054
|
warn |
|
402
|
|
|
|
|
|
|
'"todo_failed" is deprecated. Please use "todo_passed". See the docs.'; |
|
403
|
1
|
|
|
|
|
12
|
goto &todo_passed; |
|
404
|
|
|
|
|
|
|
} |
|
405
|
|
|
|
|
|
|
|
|
406
|
|
|
|
|
|
|
=head1 See Also |
|
407
|
|
|
|
|
|
|
|
|
408
|
|
|
|
|
|
|
L |
|
409
|
|
|
|
|
|
|
|
|
410
|
|
|
|
|
|
|
L |
|
411
|
|
|
|
|
|
|
|
|
412
|
|
|
|
|
|
|
=cut |
|
413
|
|
|
|
|
|
|
|
|
414
|
|
|
|
|
|
|
1; |