httpd-test-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geoffrey Young <ge...@modperlcookbook.org>
Subject Re: using TestRunPerl without mod_perl.c
Date Thu, 02 Oct 2003 21:04:40 GMT


> why would you use TestRunPerl to test against not-modperl enabled 
> Apache? If by accident I think it is better to discover that and die 
> before even starting to run tests.

in a third-party (CPAN) module, you don't have much control.

say I want to test my module against mod_perl.  I need to use TestRunPerl if 
I want stuff like modperl_inc.pl to work.  but the end-user passes me

perl Makefile.PL -apxs /some/no-perl/apache/bin/apxs

and the server blows up.  at least if you have no -apxs, you get a nice warning.

the issue here is a real one for me - I'm working on a distribution where 
only one file is mod_perl based, and I can't assume that even though I want 
the mod_perl stuff enabled, the user actually has it.

> 
>> the end result is that, within the tests, have_module('foo.c') works 
>> for every module _except_ mod_perl, since if mod_perl isn't installed 
>> the test suit never gets started.
> 
> 
> Again, it should be solved at a much earlier stage, rather than waiting 
> for the server to start. It should alert the user during the config 
> stage and die right there.
> 
>> anyway, I think it's a good practice to <IfModule> non-core 
>> directives, and it looks like that is being done most of the time 
>> (Alias seems to be the exception).  the attached patch does that for 
>> mod_perl stuff.
> 
> 
> Not quite so, TestRunPerl already assumes that mod_perl is available. 

that's a bad assumption.  since you configure TestRunPerl from the perl 
Makefile.PL stage, you can't know what the end-user has on his system.

besides, if you want to do

t/TEST -apxs /with-modperl/bin/apxs

t/TEST -apxs /without-modperl/bin/apxs

I think that should be ok, and you have have_module('mod_perl.c') to allow 
just that.

> Adding noise to httpd.conf doesn't make things better.

it's not noise.  if it were then there would be no reason to <IfModule> out 
the LoadModule statement for mod_perl.

> Besides if you 
> could do:
> 
> <IfModule mod_perl.c>
>   all mp configs
> </IfModule>
> 
> and not ifmodule for each directive that would be better I guess.

yes, I thought so too.  but the code for each of those is scattered about 
the suite, which makes it difficult to tie each of them together nicely.

--Geoff


Mime
View raw message