We have a Makefile.PL that uses Module::Install.  We use "requires"
to check for dependencies required to *run* the application.  But,
there are other modules required to run the test suite.

Module::Install has a "test_requires" which would seem perfect, but
using test_requires still results in this when running Makefile.PL:

    ==> Auto-install the 1 mandatory module(s) from CPAN? [y] n
    ==> The module(s) are mandatory! Really skip? [n] y
    Warning: prerequisite Foo::Bar 3.3 not found.

Which doesn't look any different than the "requires" dependencies.

Perhaps I'm not understanding how "test_requires" is suppose to work.

I think what we want is to just check for the modules when "make test"
is run.

Currently, we check for the testing modules in a separate PRIVATE.pm
module in MY::test().

That is, in MY::test if, say, Test::More of a specific version does
not exist set the "test" Makefile target to exit with an error message
saying which modules are missing.  The result is we find out about the
missing dependency when we run "make test".

Is this the correct approach?


My next question is there a way to use the existing Module::Install
"requires" feature to load and test the versions of the modules in our
My::test() function?

Currently, we have a rather simple approach:

    ( eval { require Test::More } and ( $Test::More::VERSION >= 0.62 ) )
        or push @fails, 'Test::More 0.62';

I know real-life version testing is a bit more involved that that.

It would be nice if we could use the existing "requires" code
that Module::Install uses to check if the module can be loaded and is
the correc version -- and even perhaps provide an "installdeps"
type of target for the missing testing modules.







-- 
Bill Moseley
mose...@hank.org
Sent from my iMutt

Reply via email to