simonm has asked for the wisdom of the Perl Monks concerning the following question:
Greetings, fellow monks.
I seek your wisdom regarding the organization of test scripts in large CPAN distributions. Specifically, Class::MakeMethods has numerous subclasses, each with several tests, and I'm trying to arrange the resulting pile of over 100 test scripts.
My intent has been to group the tests so that the more basic tests ran first, with new and experimental modules tested later, and so that related tests would run together.
In older releases, I added a digit to the start of each test's name to control its position in the test sequence. This works, although it seems a bit opaque, and it scales poorly as new tests are added.
Subsequently, I tried breaking the distribution up into smaller chunks (1, 2, 3), but this made distribution and updates more of a hassle. When recombining the distributions, I experimented with packaging them together, with a primary makefile that recursed down to subdirectories each with their own makefile and collection of tests. However, some light reading seemed to suggest that this might not be very portable.
Most recently, I tried using a single makefile, but kept the tests in subdirectories of t/, and passed 'TESTS' => 't/*/*.t' to MakeMaker's WriteMakefile. Unfortunately, that fails due to limitations of glob() on some platforms (read, Windows).
The one thing that I know will work is to go back to one big directory with numeric prefixes, but I'm not quite ready to give up. The machines I have easy access to are all Unix variants, so I hoped to find some cross-platform assistance here.
Is there some simple, portable way of accomplishing this multi-level directory globbing so I can keep my tests in subdirectories without overburdening my Makefile.PL? (File::DosGlob seems to handle directory recursion; would conditionally including it on Windows do me any good?)
At first glance, it doesn't seem like switching from MakeMaker to Module::Build would make any difference; am I overlooking something?
Alternately, is there some existing set of practices that would help to address this?
Many thanks in advance for any suggestions.
|
|---|