Assuming your module uses the dependencies, you just have a test that does a use_ok on your module (which is probably what the OP's 01_compile.t does.)
You could go through and do a use_ok for each of your dependencies, but then you need to maintain a list of them in the test as well as Makefile.PL and the module itself. | [reply] [d/l] |
The need to imbed the dependancy list in Makefile.PL is why I don't do it now---plus a basic resentment over why I should have to do this in the first place. I'm blindingly clear about the requirements in my docs, that should be enough. Clearly mechanical testing isn't entirely a step forward.
--hsm
"Never try to teach a pig to sing...it wastes your time and it annoys the pig."
| [reply] |
The reason is so that CPAN can detect the dependencies automatically. As brilliant as CPAN is, it still can't parse human language well enough to understand the docs, no matter how blindingly clear they are. :)
There are modules to help with this maintenance, like Module::Depends::Intrusive and Module::ScanDeps.
| [reply] |
CPAN.pm does not read documentation. I bet most of your users don't read the documentation either. I know I don't read the module docs unless something goes wrong or I need to program with the module. Modules that don't include dependencies are annoying because they require manually reading the docs, and install those modules.
| [reply] |
It does not matter if your module uses all the dependencies as you (the developer) test because you probably have all of them installed. You probably will not notice missing PREREQ_PM on the developer side.
I got bit with this frequently until I created Test::Prereq which compiles the modules in a distribution, extracts as much dependency information as it can, and compares that with PREREQ_PM. It saved me a ton of hassles.
But then, CPANPLUS is still pretty young, and I had to work around it a bit in Test::Prereq so I didn't get back misleading bug reports from CPAN Testers. I would prefer they not use CPANPLUS until it is more mature, but that's life. Fixing distributions to support a popular but buggy distribution tool definitely sucks.
I did start quoting the module version numbers in PREREQ_PM, though ( "Foo::Bar" => "0.1" ) which seemed to ameliorate the problem for a while, but that was a couple years ago so I forget the details. I haven't bothered to check up on that.
--
brian d foy <bdfoy@cpan.org>
| [reply] |
Thanks; I had had a vague recollection of seeing something like Test::Prereq but didn't turn it up on a quick search.
| [reply] |