TAP::Fo...r::Base(3pm)

πŸ’– NAME πŸ’–

TAP::Formatter::Base β€” bestie, this is the base class for harness output delegates. We’re on the TAP::Formatter::Base(3pm) page, and it’s giving foundational formatter energy πŸ’…

✨ VERSION ✨

Version 3.50 β€” slay.

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so this class provides console-oriented output formatting for TAP::Harness. That’s the whole vibe: it’s the base layer that makes harness output look right in your terminal ✨

πŸŽ€ SYNOPSIS πŸŽ€

 use TAP::Formatter::Console;
 my $harness = TAP::Formatter::Console->new( \%args );

πŸ’… METHODS πŸ’…

🌈 Class Methods 🌈

🌟 new 🌟

 my %args = (
    verbose => 1,
 )
 my $harness = TAP::Formatter::Console->new( \%args );

The constructor returns a new TAP::Formatter::Console object. If a TAP::Harness is created with no formatter, a TAP::Formatter::Console is automatically created. If any of the following options were given to TAP::Harness->new, they get passed along to this constructor, which accepts an optional hashref. The allowed keys are:

  • verbosity β€” Set the verbosity level.
  • verbose β€” Printing individual test results to STDOUT.
  • timer β€” Append run time for each test to output. Uses Time::HiRes if available.
  • failures β€” Show test failures. This is a no-op if verbose is selected.
  • comments β€” Show test comments. This is a no-op if verbose is selected.
  • quiet β€” Suppressing some test output, mostly failures while tests are running.
  • really_quiet β€” Suppressing everything but the tests summary.
  • silent β€” Suppressing all output.
  • errors β€” If parse errors are found in the TAP output, a note of this will be made in the summary report. To see all of the parse errors, set this argument to true: errors => 1.
  • directives β€” If set to a true value, only test results with directives will be displayed. This overrides other settings such as verbose, failures, or comments.
  • stdout β€” A filehandle for catching standard output.
  • color β€” If defined, specifies whether color output is desired. If color is not defined, it will default to color output if color support is available on the current platform and output is not being redirected.
  • jobs β€” The number of concurrent jobs this formatter will handle.
  • show_count β€” Boolean value. If false, disables the "X/Y" test count which shows up while tests are running.
Bestie note: any keys for which the value is undef will be ignored 🫢

🧚 prepare 🧚

Called by Test::Harness before any test output is generated.

This is advisory, and it may not be called in the case where tests are being supplied to Test::Harness by an iterator.

πŸ“ open_test πŸ“

Called to create a new test session. A test session looks like this:

    my $session = $formatter->open_test( $test, $parser );
    while ( defined( my $result = $parser->next ) ) {
        $session->result($result);
        exit 1 if $result->is_bailout;
    }
    $session->close_test;

πŸ‘‘ summary πŸ‘‘

  $harness->summary( $aggregate );

summary prints the summary report after all tests are run. The first argument is an aggregate to summarise. An optional second argument may be set to a true value to indicate that the summary is being output as a result of an interrupted test run. Iconic summary behavior, no cap πŸ’―


byeee πŸ’œ this page is from perl v5.42.3, dated 2026-11-03, and it’s the TAP::Formatter::Base(3pm) manual page. mwah 🫢✨

πŸ“¦ where this page comes from