httpd-test-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <>
Subject Re: [PATCH] Allow loading builtin dso modules
Date Mon, 20 Dec 2004 04:46:59 GMT
Chia-Liang Kao wrote:

>  Allow core modules to be loaded explicitly with find_and_load_module.
>  This allows the apache from FreeBSD ports (with most modules built as
>  shared) to run tests with Apache::Test, and also allows testing svk
>  with a dav server.
>  * Apache/
>    (find_and_load_module): New.
>    (generate_types_config): Use find_and_load_module to load mod_alias.
>    (httpd_config): Load mod_cgi and mod_access as they are part of the
>      core tests.

I like the find_and_load_module wrapper as it refactors some code dups.

But I don't think A-T should try to load any module someone may need in 
their test suite. It does have a bunch of mp2 specific things which should 
be wiped away and moved into the mp2 test suite.

This is your own test suite that you have the problem with, right? In 
which case I'd prefer to see a patch which subclasses Apache::TestConfig, 
so any test suite using A-T could decide which modules it wants to enforce 
loading from t/TEST. As we don't have any examples of how to subclass 
A-TC, let me know if you need help (it might be a tricky thing to do). You 
can see how we subclass Apache::TestRun in Apache-Test/t/TEST.PL.

Another possible solution is to provide a t/TEST option -load_module, 
which can be repeated several times, and will try to call your 
find_and_load_module. So you could add it into t/TEST directly as if it 
was passed from the command line.

> +    $self->find_and_load_module ('');
> +    $self->find_and_load_module ('');

> +sub find_and_load_module {
> +    my ($self, $name) = @_;
> +    my $mod_path = $self->find_apache_module($name) or return;
> +    my ($sym) = $name =~ m/mod_(\w+)\./;
> +
> +    if ($mod_path && -e $mod_path) {
> +        $self->preamble(IfModule => "!$name",
> +                        qq{LoadModule ${sym}_module "$mod_path"\n});
> +    }
> +    return 1;
> +}

Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker     mod_perl Guide --->

View raw message