"Fossies" - the Fresh Open Source Software Archive

Member "install-tl-20200916/tlpkg/tlperl/lib/TAP/Formatter/File/Session.pm" (10 Mar 2019, 2217 Bytes) of package /windows/misc/install-tl.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Perl source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 package TAP::Formatter::File::Session;
    2 
    3 use strict;
    4 use warnings;
    5 use base 'TAP::Formatter::Session';
    6 
    7 =head1 NAME
    8 
    9 TAP::Formatter::File::Session - Harness output delegate for file output
   10 
   11 =head1 VERSION
   12 
   13 Version 3.42
   14 
   15 =cut
   16 
   17 our $VERSION = '3.42';
   18 
   19 =head1 DESCRIPTION
   20 
   21 This provides file orientated output formatting for L<TAP::Harness>.
   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     my $self   = shift;
   38     my $result = shift;
   39 
   40     my $parser    = $self->parser;
   41     my $formatter = $self->formatter;
   42 
   43     if ( $result->is_bailout ) {
   44         $formatter->_failure_output(
   45                 "Bailout called.  Further testing stopped:  "
   46               . $result->explanation
   47               . "\n" );
   48         return;
   49     }
   50 
   51     if (!$formatter->quiet
   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         $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     my $self = shift;
   70 
   71     # Avoid circular references
   72     $self->parser(undef);
   73 
   74     my $parser    = $self->parser;
   75     my $formatter = $self->formatter;
   76     my $pretty    = $formatter->_format_name( $self->name );
   77 
   78     return if $formatter->really_quiet;
   79     if ( my $skip_all = $parser->skip_all ) {
   80         $formatter->_output( $pretty . "skipped: $skip_all\n" );
   81     }
   82     elsif ( $parser->has_problems ) {
   83         $formatter->_output(
   84             $pretty . ( $self->{results} ? "\n" . $self->{results} : "\n" ) );
   85         $self->_output_test_failure($parser);
   86     }
   87     else {
   88         my $time_report = $self->time_report($formatter, $parser);
   89         $formatter->_output( $pretty
   90               . ( $self->{results} ? "\n" . $self->{results} : "" )
   91               . $self->_make_ok_line($time_report) );
   92     }
   93 }
   94 
   95 1;