line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package TAP::Formatter::File::Session; |
2
|
|
|
|
|
|
|
|
3
|
15
|
|
|
15
|
|
79
|
use strict; |
|
15
|
|
|
|
|
21
|
|
|
15
|
|
|
|
|
386
|
|
4
|
15
|
|
|
15
|
|
57
|
use warnings; |
|
15
|
|
|
|
|
18
|
|
|
15
|
|
|
|
|
356
|
|
5
|
15
|
|
|
15
|
|
57
|
use base 'TAP::Formatter::Session'; |
|
15
|
|
|
|
|
17
|
|
|
15
|
|
|
|
|
6247
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 NAME |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
TAP::Formatter::File::Session - Harness output delegate for file output |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 VERSION |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
Version 3.38 |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=cut |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
our $VERSION = '3.38'; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=head1 DESCRIPTION |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
This provides file orientated output formatting for L. |
22
|
|
|
|
|
|
|
It is particularly important when running with parallel tests, as it |
23
|
|
|
|
|
|
|
ensures that test results are not interleaved, even when run |
24
|
|
|
|
|
|
|
verbosely. |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=cut |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head1 METHODS |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=head2 result |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
Stores results for later output, all together. |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=cut |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub result { |
37
|
386
|
|
|
386
|
1
|
385
|
my $self = shift; |
38
|
386
|
|
|
|
|
330
|
my $result = shift; |
39
|
|
|
|
|
|
|
|
40
|
386
|
|
|
|
|
887
|
my $parser = $self->parser; |
41
|
386
|
|
|
|
|
733
|
my $formatter = $self->formatter; |
42
|
|
|
|
|
|
|
|
43
|
386
|
100
|
|
|
|
860
|
if ( $result->is_bailout ) { |
44
|
2
|
|
|
|
|
10
|
$formatter->_failure_output( |
45
|
|
|
|
|
|
|
"Bailout called. Further testing stopped: " |
46
|
|
|
|
|
|
|
. $result->explanation |
47
|
|
|
|
|
|
|
. "\n" ); |
48
|
2
|
|
|
|
|
4
|
return; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
384
|
100
|
66
|
|
|
1029
|
if (!$formatter->quiet |
|
|
|
66
|
|
|
|
|
52
|
|
|
|
|
|
|
&& ( $formatter->verbose |
53
|
|
|
|
|
|
|
|| ( $result->is_test && $formatter->failures && !$result->is_ok ) |
54
|
|
|
|
|
|
|
|| ( $formatter->comments && $result->is_comment ) |
55
|
|
|
|
|
|
|
|| ( $result->has_directive && $formatter->directives ) ) |
56
|
|
|
|
|
|
|
) |
57
|
|
|
|
|
|
|
{ |
58
|
31
|
|
|
|
|
70
|
$self->{results} .= $self->_format_for_output($result) . "\n"; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head2 close_test |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
When the test file finishes, outputs the summary, together. |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=cut |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub close_test { |
69
|
91
|
|
|
91
|
1
|
114
|
my $self = shift; |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
# Avoid circular references |
72
|
91
|
|
|
|
|
265
|
$self->parser(undef); |
73
|
|
|
|
|
|
|
|
74
|
91
|
|
|
|
|
178
|
my $parser = $self->parser; |
75
|
91
|
|
|
|
|
208
|
my $formatter = $self->formatter; |
76
|
91
|
|
|
|
|
315
|
my $pretty = $formatter->_format_name( $self->name ); |
77
|
|
|
|
|
|
|
|
78
|
91
|
100
|
|
|
|
292
|
return if $formatter->really_quiet; |
79
|
72
|
100
|
|
|
|
194
|
if ( my $skip_all = $parser->skip_all ) { |
|
|
100
|
|
|
|
|
|
80
|
4
|
|
|
|
|
82
|
$formatter->_output( $pretty . "skipped: $skip_all\n" ); |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
elsif ( $parser->has_problems ) { |
83
|
|
|
|
|
|
|
$formatter->_output( |
84
|
32
|
100
|
|
|
|
245
|
$pretty . ( $self->{results} ? "\n" . $self->{results} : "\n" ) ); |
85
|
32
|
|
|
|
|
457
|
$self->_output_test_failure($parser); |
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
else { |
88
|
36
|
|
|
|
|
158
|
my $time_report = $self->time_report($formatter, $parser); |
89
|
|
|
|
|
|
|
$formatter->_output( $pretty |
90
|
36
|
100
|
|
|
|
195
|
. ( $self->{results} ? "\n" . $self->{results} : "" ) |
91
|
|
|
|
|
|
|
. $self->_make_ok_line($time_report) ); |
92
|
|
|
|
|
|
|
} |
93
|
|
|
|
|
|
|
} |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
1; |