Test::Run Test::Run - a New and Improved Test Harness #8

Back to Colouring...

package Test::Run::Plugin::ColorSummary;

use warnings;
use strict;

use NEXT;
use Term::ANSIColor;

sub _report_success
{
    my $self = shift;
    print color("bold blue");
    $self->NEXT::_report_success();
    print color("reset");
}

sub _handle_runtests_error
{
    my $self = shift;
    my (%args) = @_;
    my $error = $args{'error'};

    print STDERR color("bold red");
    print STDERR $error;
    print STDERR color("reset");
    # Workaround to make sure color("reset") is accepted and a red cursor
    # is not displayed.
    print STDERR "\n";
}

1;
Copyright © 2005 Shlomi Fish