in reply to Use a standard module or a "better" one, and how to make installing it troublefree.
First question is, do you use Test::More's improvements? I find that the standard Test module covers basic tests pretty well. No sense using Test::More unless you need it.
If you decide that you truly need Test::More's added flexibility, you can add a PREREQ_PM attribute to your WriteMakefile() call in Makefile.PL. It's a hashref, with the names being the module names and the values being the version number required for your script to run. Version number '0' means 'Any version'. Here's what it would be for a module called 'Devel::Refactorizer':
WriteMakefile( 'NAME' => 'Devel::Refactorizer', 'VERSION_FROM' => 'Refactorizer.pm', # finds $VERSION 'PREREQ_PM' => { 'Test::More' => 0}, # e.g., Module::Name +=> 1.1 ($] >= 5.005 ? ## Add these new keywords supported since 5.005 (ABSTRACT_FROM => 'Refactorizer.pm', # retrieve abstract from mo +dule AUTHOR => 'A. U. Thor <a.u.thor@a.galaxy.far.far.away>') : +()), );
Truth in advertising: much of what I'm saying here is stuff I'm reading from the documentation right now for the first time. :)
If you were to install this module using CPAN, it would first attempt to do a 'make' on the distribution. This attempt would fail, since the Makefile will complain about lacking the Test::More module. Then, the CPAN module would download Test::More, build it, and then re-run 'make' on the Refactorizer. CPAN runs 'make test' after 'make', so Test::More would be in place for the tests.
Another approach: some folks bundle Test::More along with their module distributions. I personally think that this method clutters CPAN; observe what happens when you search for Test::More with search.cpan.org. However, it's a fairly small module, and some pretty bright people take this approach, so YMMV.
stephen
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Use a standard module or a "better" one, and how to make installing it troublefree.
by Dog and Pony (Priest) on Apr 14, 2002 at 16:44 UTC | |
by stephen (Priest) on Apr 14, 2002 at 16:57 UTC |