Dmitri Tikhonov wrote: > Dear fellow Perl module authors: > > I have a test suite for my distribution (RT-Client-REST) that requires > some modules that the module itself does not require (Test::Exception, > for example). Since it is not listed as a dependency, some people's > tests fail[1,2]. > > Question: is it a good idea to put Test::Exception in as a dependency? > My problem with this is that the module itself, once installed, does > not use Test::Exception, so it is not really a dependency. On the other > hand, I want all tests to run (most of them test exceptions), so I do > not want to 'skip' any tests. >
I've taken a number of approaches to this question: 1. Include distributions in the PREREQ_PM key in Makefile.PL, which forces installation just as it would for modules needed for the .pm files. 2. Include the needed modules (or just enough of them as are needed for the testing to work) under a t/lib/ or t/testlib/ directory. 3. Put the individual tests which need the modules inside SKIP blocks. Other people -- who are more fluent in writing Makefiles than I -- have taken this approach: 4. Do #3 above, but write Makefile.PL such that it prompts the user to install the needed modules. #3 is my current practice. TMTOWTDI. Jim Keenan