line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package TAP::Formatter::File::Session; |
2
|
|
|
|
|
|
|
|
3
|
17
|
|
|
17
|
|
150
|
use strict; |
|
17
|
|
|
|
|
49
|
|
|
17
|
|
|
|
|
525
|
|
4
|
17
|
|
|
17
|
|
106
|
use warnings; |
|
17
|
|
|
|
|
40
|
|
|
17
|
|
|
|
|
532
|
|
5
|
17
|
|
|
17
|
|
103
|
use base 'TAP::Formatter::Session'; |
|
17
|
|
|
|
|
41
|
|
|
17
|
|
|
|
|
8120
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 NAME |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
TAP::Formatter::File::Session - Harness output delegate for file output |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 VERSION |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
Version 3.40_01 |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=cut |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
our $VERSION = '3.40_01'; |
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
|
1240
|
my $self = shift; |
38
|
386
|
|
|
|
|
850
|
my $result = shift; |
39
|
|
|
|
|
|
|
|
40
|
386
|
|
|
|
|
1550
|
my $parser = $self->parser; |
41
|
386
|
|
|
|
|
1364
|
my $formatter = $self->formatter; |
42
|
|
|
|
|
|
|
|
43
|
386
|
100
|
|
|
|
1810
|
if ( $result->is_bailout ) { |
44
|
2
|
|
|
|
|
15
|
$formatter->_failure_output( |
45
|
|
|
|
|
|
|
"Bailout called. Further testing stopped: " |
46
|
|
|
|
|
|
|
. $result->explanation |
47
|
|
|
|
|
|
|
. "\n" ); |
48
|
2
|
|
|
|
|
9
|
return; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
384
|
100
|
100
|
|
|
1888
|
if (!$formatter->quiet |
|
|
|
100
|
|
|
|
|
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
|
|
|
|
|
180
|
$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
|
350
|
my $self = shift; |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
# Avoid circular references |
72
|
91
|
|
|
|
|
580
|
$self->parser(undef); |
73
|
|
|
|
|
|
|
|
74
|
91
|
|
|
|
|
366
|
my $parser = $self->parser; |
75
|
91
|
|
|
|
|
384
|
my $formatter = $self->formatter; |
76
|
91
|
|
|
|
|
652
|
my $pretty = $formatter->_format_name( $self->name ); |
77
|
|
|
|
|
|
|
|
78
|
91
|
100
|
|
|
|
531
|
return if $formatter->really_quiet; |
79
|
72
|
100
|
|
|
|
368
|
if ( my $skip_all = $parser->skip_all ) { |
|
|
100
|
|
|
|
|
|
80
|
4
|
|
|
|
|
57
|
$formatter->_output( $pretty . "skipped: $skip_all\n" ); |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
elsif ( $parser->has_problems ) { |
83
|
|
|
|
|
|
|
$formatter->_output( |
84
|
32
|
100
|
|
|
|
437
|
$pretty . ( $self->{results} ? "\n" . $self->{results} : "\n" ) ); |
85
|
32
|
|
|
|
|
924
|
$self->_output_test_failure($parser); |
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
else { |
88
|
36
|
|
|
|
|
356
|
my $time_report = $self->time_report($formatter, $parser); |
89
|
|
|
|
|
|
|
$formatter->_output( $pretty |
90
|
36
|
100
|
|
|
|
409
|
. ( $self->{results} ? "\n" . $self->{results} : "" ) |
91
|
|
|
|
|
|
|
. $self->_make_ok_line($time_report) ); |
92
|
|
|
|
|
|
|
} |
93
|
|
|
|
|
|
|
} |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
1; |