Re: [Module::Build] [RFC] author tests
Status: Beta
Brought to you by:
kwilliams
|
From: Chris D. <ch...@cl...> - 2006-02-02 16:07:52
|
On Feb 2, 2006, at 6:49 AM, David Golden wrote:
> Eric Wilhelm wrote:
>> I guess I'm undecided on this. On the one hand, the *.ta
>> convention is going to break the test juggler with which I've
>> recently been experimenting, but on the other it means there is
>> less 'whoami' code in the tests. An example of my current whoami-
>> based approach is below.
>
> My thought was that if someone wants to use *.ta files or a ta/*.t
> directory, they can still do so by subclassing in Build.PL and
> having a custom authortest action that includes those files.
Oh, sure, everything I've suggested in this thread *could* be done as
Build.PL customization. But the reason I brought this up was to try
to achieve some consensus and find a Best Practice before the Cargo
Cult started by Test::Pod takes a deeper hold.
I like the thought of having this as a feature in M::B because then
it flattens the learning curve for a third party to mess with my
author tests. And as a corollary, I don't have to scratch my head as
much when looking at someone else's author tests.
As a concrete example, take this standard pod.t:
use Test::More;
eval "use Test::Pod 1.14";
plan skip_all => "Test::Pod 1.14 required for testing POD" if $@;
all_pod_files_ok();
and rewrite as a hypothetical author test (I'm not advocating for
"RUN_AUTHOR_TESTS" as a name):
use Test::More;
plan skip_all => "author test" if (!$ENV{RUN_AUTHOR_TESTS});
eval 'use Test::Pod 1.14';
all_pod_files_ok();
This is NOT simpler, but is slightly more standardizable since the
first two lines could be identical for every author test.
Additionally, the first one implies to the user that their Perl
environment may be substandard without Test::Pod when really the lack
of Test::Pod is really a performance benefit to them if they're not a
developer!
Chris
--
Chris Dolan, Software Developer, Clotho Advanced Media Inc.
608-294-7900, fax 294-7025, 1435 E Main St, Madison WI 53703
vCard: http://www.chrisdolan.net/ChrisDolan.vcf
Clotho Advanced Media, Inc. - Creators of MediaLandscape Software
(http://www.media-landscape.com/) and partners in the revolutionary
Croquet project (http://www.opencroquet.org/)
|