I have a project at work that involves a large C++ program which calls embedded perl and uses many perl modules in other directories. The boss required that the project be testable with a ExtUtils::MakeMaker "make test". He also required that I start with files generated by h2xs.
I have created a dummy module 'Xyz.pm' in the working directory, and forced MakeMaker to ignore everything else, like this:
I put several test scripts (using Test::More) down into a "t/" directory, and now I can use the regular "perl Makefile.PL; make; make test" to do testing without disturbing the rest of the project.use ExtUtils::MakeMaker; # See lib/ExtUtils/MakeMaker.pm for details of how to influence # the contents of the Makefile that is written. WriteMakefile( 'NAME' => 'Xyz', 'VERSION_FROM' => 'Xyz.pm', # finds $VERSION 'PREREQ_FATAL' => 1, # force prereq checks 'PREREQ_PM' => { 'DateTime' => '0', # X ? # # more prerequisites here, generated with /scandeps.pl }, # e.g., Module::Name => 1.1 'PREFIX' => '~/xyz_dummy', # shanghai install for now ); package MY; # Drastic fix for pulling the world into blib: eliminate all but Xyz.p +m sub libscan { my $self = shift; my $file = shift; return $file !~ /Xyz\.pm/ ? 0 : $self->SUPER::libscan($file); }
Does anyone have suggestions on how I could improve this testing environment? Thanks.
In reply to MakeMaker for testing only by tall_man
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |