Re: [Module-build-general] RFC: Build test test_dirs=(list)
Status: Beta
Brought to you by:
kwilliams
|
From: Michael G S. <sc...@po...> - 2003-08-12 02:12:03
|
On Mon, Aug 11, 2003 at 03:18:10PM -0700, David Carmean wrote:
> Just today I've created a builder subclass and have overridden the
> test_files() method to look for $self->{args}{test_dirs} and add all the
> *.t files found in or beneath those directories; IMO much more convenient
> than typing a long list for $self->{args}{test_files}. So for instance
> when I'm creating the Foo::Bar::Baz::Feh module in package Foo::Bar,
> all the tests for Feh live in t/Foo/Bar/Baz/Feh, and I run "Build test
> test_dirs=t/Foo/Bar/Baz/Feh".
The trouble with doing this by default is it makes this sort of testing
very difficult:
t/foo.t
t/Dummy-Module/lib/Dummy/Module.pm
t/Dummy-Module/t/Foo.t
where foo.t needs a little module to test with. If you go recursive in
scanning for .t files you'll pick up Foo.t. There are workarounds but
they're similar to yours above so you're just shifting the problem.
What might be better is a simple flag you can pass to Module::Build->new()
which says "check recursively for tests". Whether or not this should be
the default is a matter to be settled by a steel cage match.
> I'm trying to think of a reason not to have it add *.pl as well....?
The more things you look for as tests the harder it will be to have testing
data in t/. Its desirable to keep the number of magical files to a minimum
else you magic it difficult to shake off that magic.
Since there's no compelling use-case for making *.pl magical other than "Look,
we can name it something else!" I'd say no.
--
Michael G Schwern sc...@po... http://www.pobox.com/~schwern/
Stupid am I? Stupid like a fox!
|