Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Passing Options to Test Files

3 views
Skip to first unread message

John M. Gamble

unread,
Nov 6, 2012, 8:23:31 PM11/6/12
to Module Build
I have tests in a module that take a long time to run. Strictly speaking,
the CPAN testers don't need to run all of them, so it makes sense to have
them automatically skipped, letting me run them manually when I want.

Reading the Module::Build::API document, I see that I can create my own
option (e.g., --Testall) using the get_options parameter. But it looks
like I can only pass information to the test files via tap_harness_args
to TAP::Harness. Currently, all but two of my test files use Test::Simple,
with the remaining files using Test::More.

Do I have to re-write my test files to use TAP::Harness?

Thanks,
-john

Leon Timmermans

unread,
Nov 7, 2012, 8:06:21 AM11/7/12
to John M. Gamble, Module Build
On Wed, Nov 7, 2012 at 2:23 AM, John M. Gamble <jga...@ripco.com> wrote:
> I have tests in a module that take a long time to run. Strictly speaking,
> the CPAN testers don't need to run all of them, so it makes sense to have
> them automatically skipped, letting me run them manually when I want.

The AUTHOR_TESTING or RELEASE_TESTING environmental variables are the
standard [1] means to get what you want.

> Reading the Module::Build::API document, I see that I can create my own
> option (e.g., --Testall) using the get_options parameter. But it looks
> like I can only pass information to the test files via tap_harness_args
> to TAP::Harness. Currently, all but two of my test files use Test::Simple,
> with the remaining files using Test::More.
>
> Do I have to re-write my test files to use TAP::Harness?

No, you don't. TAP::Harness is the TAP consumer, that checks and
summarizes the test results. Test::{Simple,More} is the TAP producer,
that outputs its result. They are decoupled.

[1]: http://use.perl.org/use.perl.org/_Alias/journal/36128.html

Leon
0 new messages