The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

TAP::Harness::Color - Run Perl test scripts with color

VERSION

Version 0.54

DESCRIPTION

Note that this harness is experimental. You may not like the colors I've chosen and I haven't yet provided an easy way to override them.

This test harness is the same as TAP::Harness, but test results are output in color. Passing tests are printed in green. Failing tests are in red. Skipped tests are blue on a white background and TODO tests are printed in white.

If Term::ANSIColor cannot be found (or Win32::Console if running under Windows) tests will be run without color.

SYNOPSIS

use TAP::Harness::Color;
my $harness = TAP::Harness::Color->new( \%args );
$harness->runtests(@tests);

METHODS

Class Methods

new

my %args = (
   verbose => 1,
   lib     => [ 'lib', 'blib/lib' ],
   shuffle => 0,
)
my $harness = TAP::Harness::Color->new( \%args );

The constructor returns a new TAP::Harness::Color object. If Term::ANSIColor is not installed, returns a TAP::Harness object. See TAP::Harness for more details.

can_color

Test::Harness::Color->can_color()

Returns a boolean indicating whether or not this module can actually generate colored output. This will be false if it could not load the modules needed for the current platform.

failure_output

$harness->failure_output(@list_of_strings_to_output);

Overrides TAP::Harness failure_output to output failure information in red.