tall_man has asked for the wisdom of the Perl Monks concerning the following question:
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: MakeMaker for testing only
by Courage (Parson) on Apr 16, 2003 at 09:52 UTC | |
|
Re: MakeMaker for testing only
by rinceWind (Monsignor) on Apr 16, 2003 at 11:17 UTC | |
by tall_man (Parson) on Apr 16, 2003 at 14:27 UTC |