Module::Build::TAPArchive - Extra build targets for creating TAP archives


Module-Build-TAPArchive documentation Contained in the Module-Build-TAPArchive distribution.

Index


Code Index:

NAME

Top

Module::Build::TAPArchive - Extra build targets for creating TAP archives

SYNOPSIS

Top

Easily add support for extra build targets that create TAP archives of the tests.

In your Build.PL

    use Module::Builder::TAPArchive;
    my $builder = Module::Builder::TAPArchive->new(
        ...
    );

Now you get these build targets

    ]$ perl Build.PL
    ]$ ./Build test_archive

NEW TARGETS

Top

The following build targets are provided:

test_archive

Create a TAP archive to the test run. This archive is placed at test_archive.tar.gz in the current directory by default. You can override this by specifying the --archive_file parameter.

    ./Build test_archive --archive_file mytests.tar.gz

AUTHOR

Top

Michael Peters, <mpeters at plusthree.com>

BUGS

Top

Please report any bugs or feature requests to bug-module-build-taparchive at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Module-Build-TAPArchive. 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 Module::Build::TAPArchive

You can also look for information at:

* RT: CPAN's request tracker

http://rt.cpan.org/NoAuth/Bugs.html?Dist=Module-Build-TAPArchive

* AnnoCPAN: Annotated CPAN documentation

http://annocpan.org/dist/Module-Build-TAPArchive

* CPAN Ratings

http://cpanratings.perl.org/d/Module-Build-TAPArchive

* Search CPAN

http://search.cpan.org/dist/Module-Build-TAPArchive/

COPYRIGHT & LICENSE

Top


Module-Build-TAPArchive documentation Contained in the Module-Build-TAPArchive distribution.
package Module::Build::TAPArchive;
use warnings;
use strict;
use base 'Module::Build';
use TAP::Harness::Archive;

our $VERSION = '0.04';

__PACKAGE__->add_property(archive_file => 'test_archive.tar.gz');

sub ACTION_test_archive {
    my $self = shift;
    $self->{properties}{use_tap_harness} = 1;
    my $archive_file = $self->{properties}{archive_file} || 'test_archive.tar.gz';

    # make Module::Build use our archive method instead of run_tap_harness
    local *Module::Build::run_tap_harness = sub {
        my ($self, $tests) = @_;
        TAP::Harness::Archive->new(
            {
                lib       => \@INC,
                verbosity => $self->{properties}{verbose},
                switches  => [$self->harness_switches],
                archive   => $archive_file,
                %{$self->tap_harness_args},
            }
        )->runtests(@$tests);
    };
    $self->add_to_cleanup($archive_file);
    $self->generic_test(type => 'default');
}


1;