Test::Run::CmdLine::Plugin::ColorFileVerdicts - Color the individual test file


Test-Run-Plugin-ColorFileVerdicts documentation Contained in the Test-Run-Plugin-ColorFileVerdicts distribution.

Index


Code Index:

NAME

Top

Test::Run::CmdLine::Plugin::ColorFileVerdicts - Color the individual test file verdicts in Test::Run::CmdLine.

VERSION

Top

0.0122

METHODS

Top

$self->private_backend_plugins()

Returns the Backend Plugins as specified by this plugin. See Test::Run::CmdLine for more information.

$self->private_non_direct_backend_env_mapping()

Returns the non-direct Backend Environment Mappings, that will specify the YAML information. See Test::Run::CmdLine for more information.

$self->private_backend_args()

Makes Test::Run::CmdLine process the PERL_HARNESS_VERDICT_COLORS environment variable.

ENVIRONMENT VARIABLES

Top

PERL_HARNESS_VERDICT_COLORS

This environment variables specifies a mapping (or hash) where the keys are the verdict types and the values are the color strings (as understood by Term::ANSIColor). So for example to specify the color "magenta" for success and "blue" for failure use:

    export PERL_HARNESS_VERDICT_COLORS="success=magenta;failure=blue"

As you can see the key/value pairs are separated with ";" and "=" is used for the assignment.

SEE ALSO

Top

Test::Run::CmdLine, Test::Run::CmdLine::Plugin::ColorSummary, Term::ANSIColor.

AUTHOR

Top

Shlomi Fish, <shlomif at cpan.org>

BUGS

Top

Please report any bugs or feature requests to bug-test-run-plugin-colorfileverdicts at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test-Run-Plugin-ColorFileVerdicts. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

Top

You can find documentation for this module with the perldoc command.

    perldoc Test::Run::Plugin::ColorFileVerdicts

You can also look for information at:

* AnnoCPAN: Annotated CPAN documentation

http://annocpan.org/dist/Test-Run-Plugin-ColorFileVerdicts

* CPAN Ratings

http://cpanratings.perl.org/d/Test-Run-Plugin-ColorFileVerdicts

* RT: CPAN's request tracker

http://rt.cpan.org/NoAuth/Bugs.html?Dist=Test-Run-Plugin-ColorFileVerdicts

* Search CPAN

http://search.cpan.org/dist/Test-Run-Plugin-ColorFileVerdicts

ACKNOWLEDGEMENTS

Top

COPYRIGHT & LICENSE

Top


Test-Run-Plugin-ColorFileVerdicts documentation Contained in the Test-Run-Plugin-ColorFileVerdicts distribution.
package Test::Run::CmdLine::Plugin::ColorFileVerdicts;

use strict;
use warnings;

our $VERSION = '0.0122';

sub private_backend_plugins
{
    my $self = shift;

    return [qw(ColorFileVerdicts)];
}

sub private_non_direct_backend_env_mapping
{
    my $self = shift;

    return
    [
        {
            type => "varmap",
            env => "PERL_HARNESS_VERDICT_COLORS",
            arg => "individual_test_file_verdict_colors",
        },
    ];
}

sub private_backend_args
{
    my $self = shift;

    return $self->_get_file_verdicts_color_mappings();
}

sub _get_file_verdicts_color_mappings
{
    my $self = shift;

    if (exists($ENV{PERL_HARNESS_VERDICT_COLORS}))
    {
        # FIXME 
        my $mapping_string = $ENV{PERL_HARNESS_VERDICT_COLORS};

        my @assignments = split(/\s*;\s*/, $mapping_string);
        return 
        [
            individual_test_file_verdict_colors => 
            {map { /\A([^=]*)=(.*)\z/ms ? ($1 => $2) : () } @assignments}
        ];
    }
    else
    {
        return [];
    }
}