|  line  | 
 stmt  | 
 bran  | 
 cond  | 
 sub  | 
 pod  | 
 time  | 
 code  | 
| 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 package TAP::Formatter::File::Session;  | 
| 
2
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
3
 | 
15
 | 
 
 | 
 
 | 
  
15
  
 | 
 
 | 
59
 | 
 use strict;  | 
| 
 
 | 
15
 | 
 
 | 
 
 | 
 
 | 
 
 | 
21
 | 
    | 
| 
 
 | 
15
 | 
 
 | 
 
 | 
 
 | 
 
 | 
413
 | 
    | 
| 
4
 | 
15
 | 
 
 | 
 
 | 
  
15
  
 | 
 
 | 
53
 | 
 use warnings;  | 
| 
 
 | 
15
 | 
 
 | 
 
 | 
 
 | 
 
 | 
21
 | 
    | 
| 
 
 | 
15
 | 
 
 | 
 
 | 
 
 | 
 
 | 
400
 | 
    | 
| 
5
 | 
15
 | 
 
 | 
 
 | 
  
15
  
 | 
 
 | 
64
 | 
 use base 'TAP::Formatter::Session';  | 
| 
 
 | 
15
 | 
 
 | 
 
 | 
 
 | 
 
 | 
24
 | 
    | 
| 
 
 | 
15
 | 
 
 | 
 
 | 
 
 | 
 
 | 
6418
 | 
    | 
| 
6
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
7
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 =head1 NAME  | 
| 
8
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
9
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 TAP::Formatter::File::Session - Harness output delegate for file output  | 
| 
10
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
11
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 =head1 VERSION  | 
| 
12
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
13
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 Version 3.39  | 
| 
14
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
15
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 =cut  | 
| 
16
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
17
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 our $VERSION = '3.39';  | 
| 
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
  
 | 
441
 | 
     my $self   = shift;  | 
| 
38
 | 
386
 | 
 
 | 
 
 | 
 
 | 
 
 | 
321
 | 
     my $result = shift;  | 
| 
39
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
40
 | 
386
 | 
 
 | 
 
 | 
 
 | 
 
 | 
869
 | 
     my $parser    = $self->parser;  | 
| 
41
 | 
386
 | 
 
 | 
 
 | 
 
 | 
 
 | 
736
 | 
     my $formatter = $self->formatter;  | 
| 
42
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
43
 | 
386
 | 
  
100
  
 | 
 
 | 
 
 | 
 
 | 
856
 | 
     if ( $result->is_bailout ) {  | 
| 
44
 | 
2
 | 
 
 | 
 
 | 
 
 | 
 
 | 
8
 | 
         $formatter->_failure_output(  | 
| 
45
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
                 "Bailout called.  Further testing stopped:  "  | 
| 
46
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
               . $result->explanation  | 
| 
47
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
               . "\n" );  | 
| 
48
 | 
2
 | 
 
 | 
 
 | 
 
 | 
 
 | 
4
 | 
         return;  | 
| 
49
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }  | 
| 
50
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
51
 | 
384
 | 
  
100
  
 | 
  
 66
  
 | 
 
 | 
 
 | 
1089
 | 
     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
 | 
 
 | 
 
 | 
 
 | 
 
 | 
86
 | 
         $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
  
 | 
120
 | 
     my $self = shift;  | 
| 
70
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
71
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     # Avoid circular references  | 
| 
72
 | 
91
 | 
 
 | 
 
 | 
 
 | 
 
 | 
253
 | 
     $self->parser(undef);  | 
| 
73
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
74
 | 
91
 | 
 
 | 
 
 | 
 
 | 
 
 | 
202
 | 
     my $parser    = $self->parser;  | 
| 
75
 | 
91
 | 
 
 | 
 
 | 
 
 | 
 
 | 
214
 | 
     my $formatter = $self->formatter;  | 
| 
76
 | 
91
 | 
 
 | 
 
 | 
 
 | 
 
 | 
311
 | 
     my $pretty    = $formatter->_format_name( $self->name );  | 
| 
77
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
78
 | 
91
 | 
  
100
  
 | 
 
 | 
 
 | 
 
 | 
321
 | 
     return if $formatter->really_quiet;  | 
| 
79
 | 
72
 | 
  
100
  
 | 
 
 | 
 
 | 
 
 | 
285
 | 
     if ( my $skip_all = $parser->skip_all ) {  | 
| 
 
 | 
 
 | 
  
100
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
80
 | 
4
 | 
 
 | 
 
 | 
 
 | 
 
 | 
32
 | 
         $formatter->_output( $pretty . "skipped: $skip_all\n" );  | 
| 
81
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }  | 
| 
82
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     elsif ( $parser->has_problems ) {  | 
| 
83
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         $formatter->_output(  | 
| 
84
 | 
32
 | 
  
100
  
 | 
 
 | 
 
 | 
 
 | 
255
 | 
             $pretty . ( $self->{results} ? "\n" . $self->{results} : "\n" ) );  | 
| 
85
 | 
32
 | 
 
 | 
 
 | 
 
 | 
 
 | 
444
 | 
         $self->_output_test_failure($parser);  | 
| 
86
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }  | 
| 
87
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     else {  | 
| 
88
 | 
36
 | 
 
 | 
 
 | 
 
 | 
 
 | 
152
 | 
         my $time_report = $self->time_report($formatter, $parser);  | 
| 
89
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         $formatter->_output( $pretty  | 
| 
90
 | 
36
 | 
  
100
  
 | 
 
 | 
 
 | 
 
 | 
185
 | 
               . ( $self->{results} ? "\n" . $self->{results} : "" )  | 
| 
91
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
               . $self->_make_ok_line($time_report) );  | 
| 
92
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }  | 
| 
93
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }  | 
| 
94
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
95
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 1;  |