Re: [Module::Build] [RFC] author tests
Status: Beta
Brought to you by:
kwilliams
|
From: Eric W. <scr...@gm...> - 2006-02-02 05:03:57
|
# from David Golden
# on Wednesday 01 February 2006 08:28 pm:
>Chris Dolan wrote:
>> I am not wed to the t/*.ta convention or the name of the ACTION. =A0
>> What do others think of the concept in general?
>
>What if "authortest" instead set an environment variable prior to
>running the normal "test" action?
I guess I'm undecided on this. On the one hand, the *.ta convention is=20
going to break the test juggler with which I've recently been=20
experimenting, but on the other it means there is less 'whoami' code in=20
the tests. An example of my current whoami-based approach is below.
I suppose it would be nice for it to work both with a *.ta typeglob and=20
to set an environment variable. Possibly the environment variable(s)=20
used should be configurable in Build.PL? e.g. it might be handy to=20
have the following sort of control:
# runs all of the *.t* files with all authortest_env =3D> [qw(POD WARN)]
./Build authortest
# just set AUTHORTEST_POD and run all *.t*
./Build authortest POD
# just set AUTHORTEST_WARN and run all *.t*
./Build authortest WARN
But then you might also want Build.PL to configure whether or not *.t=20
tests are run?
=2D------
#!/usr/bin/perl
use Test::More;
eval "use Test::Pod::Coverage 1.04";
plan skip_all =3D>
"Test::Pod::Coverage 1.04 required for testing POD coverage"
if $@;
plan skip_all =3D> '$ENV{TEST_POD_COVERAGE} is not set'
unless((($ENV{USER} || '') eq 'ewilhelm') or =20
exists($ENV{TEST_POD_COVERAGE}));
all_pod_coverage_ok();
=2D------
=2D-Eric
=2D-=20
Issues of control, repair, improvement, cost, or just plain
understandability all come down strongly in favor of open source
solutions to complex problems of any sort.
=2D-Robert G. Brown
=2D--------------------------------------------------
http://scratchcomputing.com
=2D--------------------------------------------------
|