On Tuesday 21 February 2006 20:57, Geoffrey Young wrote:
> well, I'm not sure I follow you, then.  the only real reason for wanting
> what you asked for in the first place was to prevent httpd from crashing on
> startup because of configurations options it doesn't understand.  if you
> can start httpd then you should be able to vary what you test against using
> have_min_apache_version() in the test itself.  and it looks to me like you
> can test what you're after without needing to start httpd with
> configurations that differ between 2.0 and 2.2, unless I'm completely
> misunderstanding things.
>
> so, then, why do you need a config that causes 2.0 not to start as the only
> way you can test your new functionality.  that's the real question :)

You understood me right in the first place.

Below is an excerpt from my patched response/TestAPI/access.pm. It first 
checks the Apache version then depending on it expects different output from 
my function.

This test works well with the AllowOverride line in the config for Apache 2.2 
and without it for Apache 2.0. For 2.0 the Options=... prevents httpd from 
starting up.

The question is, where do I apply your -defines trick, since mod_perl itself 
has no t/TEST.PL (TEST.PL are only in Apache-Test and ModPerl-Registry).

...
    (my $av=Apache2::ServerUtil::get_server_version)=~s!.+/!v!;
    $av=eval $av;
    ok t_cmp $r->allow_override_opts,
             ($av ge v2.2.0
              ? Apache2::Const::OPT_INDEXES |
                Apache2::Const::OPT_SYM_LINKS
              : Apache2::Const::OPT_UNSET |
                Apache2::Const::OPT_ALL |
                Apache2::Const::OPT_INCNOEXEC |
                Apache2::Const::OPT_SYM_OWNER |
                Apache2::Const::OPT_MULTI),
              'allow_override_opts';

    Apache2::Const::OK;
}

1;
__END__
AllowOverride AuthConfig Options=Indexes,FollowSymLinks
Options None
Options Indexes FollowSymLinks
AuthName modperl
AuthType none

Attachment: pgpzctQnrlNnz.pgp
Description: PGP signature

Reply via email to