On Sat, Jul 31, 2010 at 1:46 PM, Michael G Schwern <[email protected]>wrote:
> > You rarely need bail out. Assuming full coverage the tests will fail fine > on > their own when they can't find the required module. Its only to save the > user > from having to see the same failure over and over. Generally you might > have a > t/00compile.t test which checks the library compiles and only bail out if > that > fails. That will run first and end the testing early. > It's not to test if the module exists, but if the correct version exists. Again, I think the correct thing to do is have a test that checks the feature needed can be used as expected not that we have a specific version. What has happened is a developer adds a dependency on a new module. Say it's at version 1.05 on CPAN and that's the only version the developer has ever used. So, version 1.05 is listed in Makefile.PL. Well, on another environment that module might be installed with version 1.03. The tests may pass but there could be problems that 1.03 has that the developer did not experience -- and likely are not tested. The developer could also add a test for the specific version, but then they have to remember to add the version in two places. Maybe have generic .t file that tests all the modules listed in Makefile.PL. It's not always the developer that is writing the tests. Anyway, those are rare cases. -- Bill Moseley [email protected]
