James E Keenan > TAP-Harness-Multiple-0.07 > TAP::Harness::Archive::MultipleHarnesses

Download:
TAP-Harness-Multiple-0.07.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.06   Source  

NAME ^

TAP::Harness::Archive::MultipleHarnesses - Create an archive of multiple harnesses of TAP test results

SYNOPSIS ^

    use TAP::Harness::Archive::MultipleHarnesses;
    my $archive = TAP::Harness::Archive::MultipleHarnesses->new(\%args);
    $archive->runtests(\@targets);

DESCRIPTION ^

This package subclasses Michael Peters' TAP::Harness::Archive package from CPAN. It provides its own runtests() method for the case where you need to create an archive of test results generated by running multiple harnesses sequentially.

For a discussion of use cases for this functionality, see the documentation for TAP::Harness::ReportByDescription.

    perldoc TAP::Harness::ReportByDescription

METHODS ^

new()

Inherited from Test::Harness::Archive.

runtests()

Replaces Test::Harness::Archive::runtests(). Note that its interface is different from other packages' runtests() interface: It takes a reference to an array of hash references rather than a simple array.

Each hash reference holds information on how a particular set of tests is to be run. The various sets are run and placed into the archive in the order in which they appear in the array.

Each hash reference needs three elements:

summary()

Inherited from Test::Harness::Archive.

EXAMPLE ^

Adapted (simplified) from Parrot's t/fullharness.

    use Parrot::Harness::Smoke qw( collect_test_environment_data );
    use TAP::Harness::Archive::MultipleHarnesses;

    sub set_runcore_target {
        my ($target)  = @_;
        return {
            label   => "test$target",
            rule    => sub { set_runcore_environmental_args($target) },
            tests   => [
                        map { [ $_, "test${alt}__$_", ] } 
                            @Parrot::Harness::TestSets::runcore_test_files
                       ],
        };
    }
    my @targets = map { set_runcore_target($_) } ( qw| b f r | );
    my %env_data = collect_test_environment_data();

    my $archive = TAP::Harness::Archive::MultipleHarnesses->new( {
        verbosity        => $ENV{HARNESS_VERBOSE},
        archive          => 'parrot_test_run.tar.gz',
        merge            => 1,
        jobs             => $ENV{TEST_JOBS} || 1,
        extra_properties => \%env_data,
        extra_files      => [ 'myconfig', 'config_lib.pir' ],
    } );
    my $overall_aggregator = $archive->runtests(\@targets);
    $archive->summary($overall_aggregator);

AUTHOR ^

This code was derived from Michael Peters' Test::Harness::Archive distribution on CPAN, as well as examples in the documentation for TAP::Harness, TAP::Parser, TAP::Parser::Aggregator and other CPAN modules. Documentation and code assemblage by James E Keenan.

LICENSE ^

This is free software and is released under the same terms as Perl itself.

syntax highlighting: