On Wed Jun 22 04:22:37 2011, JQUELIN wrote:
Show quoted text> all the modules used in t/ (such as Apache::TestConfig) are not a build
> / test requires of this module, meaning it fails in a clean box.
That's interesting because without a proper Apache::Test installation you
don't even get past the "perl Makefile.PL" step, see:
BEGIN {
eval {
require ModPerl::MM;
require Apache::TestMM;
require File::Spec;
};
if( $@ ) {
warn $@;
exit 0;
}
Apache::TestMM->import( qw(test clean) );
File::Spec->import();
}
...
Apache::TestMM and Apache::TestConfig are both part of the Apache::Test
distribution.
You may ask why does he do it in so complicated way? The answer is
cpantesters. In their FAQ page they write:
-------------------------------------------------------------
"How can I stop getting FAIL reports for missing libraries or other non-Perl
dependencies?"
If you have some special dependencies and don't want to get CPAN Testers
reports if a dependency is not available, just exit from the Makefile.PL or
Build.PL normally (with an exit code of 0) before the Makefile or Build file
is created.
exit 0 unless some_dependency_is_met();
-------------------------------------------------------------
Normally, ExtUtils::MakeMaker or Module::Build are available because they
come with core-Perl. Apache::ModSSL's Makefile.PL does not use them. It uses
instead ModPerl::MM and Apache::TestMM already in Makefile.PL. So, a simple
"use ModPerl::MM" would make "perl Makefile.PL" die almost always. In such
cases cpantesters will generate a lot of FAIL reports that do not contain
useful information because they are expected to fail. The only way around is
"exit 0".