<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">package TAP::Formatter::File::Session;

use strict;
use warnings;
use base 'TAP::Formatter::Session';

=head1 NAME

TAP::Formatter::File::Session - Harness output delegate for file output

=head1 VERSION

Version 3.44

=cut

our $VERSION = '3.44';

=head1 DESCRIPTION

This provides file orientated output formatting for L&lt;TAP::Harness&gt;.
It is particularly important when running with parallel tests, as it
ensures that test results are not interleaved, even when run
verbosely.

=cut

=head1 METHODS

=head2 result

Stores results for later output, all together.

=cut

sub result {
    my $self   = shift;
    my $result = shift;

    my $parser    = $self-&gt;parser;
    my $formatter = $self-&gt;formatter;

    if ( $result-&gt;is_bailout ) {
        $formatter-&gt;_failure_output(
                "Bailout called.  Further testing stopped:  "
              . $result-&gt;explanation
              . "\n" );
        return;
    }

    if (!$formatter-&gt;quiet
        &amp;&amp; (   $formatter-&gt;verbose
            || ( $result-&gt;is_test &amp;&amp; $formatter-&gt;failures &amp;&amp; !$result-&gt;is_ok )
            || ( $formatter-&gt;comments   &amp;&amp; $result-&gt;is_comment )
            || ( $result-&gt;has_directive &amp;&amp; $formatter-&gt;directives ) )
      )
    {
        $self-&gt;{results} .= $self-&gt;_format_for_output($result) . "\n";
    }
}

=head2 close_test

When the test file finishes, outputs the summary, together.

=cut

sub close_test {
    my $self = shift;

    # Avoid circular references
    $self-&gt;parser(undef);

    my $parser    = $self-&gt;parser;
    my $formatter = $self-&gt;formatter;
    my $pretty    = $formatter-&gt;_format_name( $self-&gt;name );

    return if $formatter-&gt;really_quiet;
    if ( my $skip_all = $parser-&gt;skip_all ) {
        $formatter-&gt;_output( $pretty . "skipped: $skip_all\n" );
    }
    elsif ( $parser-&gt;has_problems ) {
        $formatter-&gt;_output(
            $pretty . ( $self-&gt;{results} ? "\n" . $self-&gt;{results} : "\n" ) );
        $self-&gt;_output_test_failure($parser);
    }
    else {
        my $time_report = $self-&gt;time_report($formatter, $parser);
        $formatter-&gt;_output( $pretty
              . ( $self-&gt;{results} ? "\n" . $self-&gt;{results} : "" )
              . $self-&gt;_make_ok_line($time_report) );
    }
}

1;
</pre></body></html>