Re: [Module-build-general] RFC: Build test test_dirs=(list)
Status: Beta
Brought to you by:
kwilliams
|
From: David C. <dl...@ha...> - 2003-08-12 18:26:42
|
On Mon, Aug 11, 2003 at 06:29:26PM -0700, Michael G Schwern wrote:
> 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 was suggesting a new option, not a change to the default behavior: An
argument named "test_dirs". But unless I've missed a patch since 0.19 was
posted to CPAN, M::B::Base::test_dirs already *does* recursively find ".t" files
in t/ .
> > 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.
It would just make vim recognize them as Perl files by default :o) . Speaking of
magic, where did the .t convention come from anway?
|