The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Module::Reprove - download a distribution's tests and prove them

SYNOPSIS

 my $test = CPAN::Retest->new(
    author  => 'TOBYINK',
    release => 'Object-AUTHORITY',
    version => '0.003',
    verbose => 1,
    );
 $test->run;

DESCRIPTION

This module downloads a distribution's test files (the contents of the t directory) and runs App::Prove (part of Test::Harness) on them.

It assumes that all the other files necessary for passing the test suite are already available on your system, installed into locations where the test suite will be able to find them. In particular, the libraries necessary to pass the test suite must be installed.

It makes a number of assumptions about how a distribution's test cases are structured, but these assumptions do tend to hold in most cases.

Constructor

new(%attributes)

Construct an object with given attributes. This is a Moose-based class.

Attributes

release

Release name, e.g. "Moose" or "RDF-Trine". Required.

version

Release version, e.g. "2.0001" or "0.136". Required.

author

Release author's CPAN ID, e.g. "DOY" or "GWILLIAMS". If this is not provided, it can usually be figured out using the MetaCPAN API, but it's a good idea to provide it.

verbose

Boolean indicating whether output should be verbose. Optional, defaults to false.

manifest

An arrayref of strings, listing all the files in the distribution. Don't provide this to the constructor - just allow Module::Reprove to build it.

testdir

A File::Temp::Dir object pointing to a directory which contains a subdirectory "t" full of test files. Don't provide this to the constructor - just allow Module::Reprove to build it.

There is also a pseudo-attribute module which may be provided to the constructor, and allows the automatic calculation of release, version and author. There is no getter/setter method for module though; it is not a true attribute.

Methods

test_files

Returns a list of test case files, based on the contents of the manifest.

run

Runs the test using App::Prove::run and returns whatever App::Prove would have returned, which is undocumented but appears to be false if there are test failures, and true if all tests pass.

BUGS

Please report any bugs to http://rt.cpan.org/Dist/Display.html?Queue=App-Reprove.

SEE ALSO

App::Prove.

AUTHOR

Toby Inkster <tobyink@cpan.org>.

COPYRIGHT AND LICENCE

This software is copyright (c) 2011 by Toby Inkster.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

DISCLAIMER OF WARRANTIES

THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.