Re: Apache::Test question

[prev] [thread] [next] [Date index for 2004/12/15]

From: Stas Bekman
Subject: Re: Apache::Test question
Date: 19:46 on 15 Dec 2004
Torsten Foertsch wrote:
> Hi,
> 
> I want my test suite run once with mod_ssl.so loaded and once without. My 
> TEST.PL looks this:
> 
> use strict;
> use warnings FATAL => 'all';
> 
> use lib qw(lib);
> 
> use Apache::TestRunPerl ();
> 
> my $I=Apache::TestRunPerl->new;
> 
> $I->run(@ARGV);
> 
> Apache::TestConfig::autoconfig_skip_module_add('mod_ssl.c');
> 
> $I->refresh;
> 
> $I->run(@ARGV);

you probably want to copy @ARGV away and pass a copy, since run() mangles it.

> This works fine but I need to know in my handlers and in the tests itself what 
> case is running. For the handlers I set a variable in extra.conf.in:
> 
> <IfModule mod_ssl.c>
>     PerlSetVar HAVE_SSL 1
> </IfModule>
> 
> But how do I know it in the tests? Is there another way except of scanning 
> conf/httpd.conf?

You do:

use Apache::Test;
plan tests => 5, need_module 'ssl';

It's documented in the Apache::Test manpage and also here:
http://perl.apache.org/docs/general/testing/testing.html
feel free to suggest an improvement if you couldn't find that information 
when you read those docs. (you did read those, right? :)

BTW, I don't think we have this technique documented anywhere, if you 
could submit it as a patch to testing.pod that would be a great addition.

        -- 
        __________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@xxxxxx.xxx http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html

(message missing)

Apache::Test question
Torsten Foertsch 10:31 on 15 Dec 2004

Re: Apache::Test question
Stas Bekman 19:46 on 15 Dec 2004

Re: Apache::Test question
Torsten Foertsch 14:50 on 16 Dec 2004

Re: Apache::Test question
Stas Bekman 16:28 on 16 Dec 2004

Re: Apache::Test question
William McKee 21:19 on 16 Dec 2004

Re: Apache::Test question
Stas Bekman 23:28 on 16 Dec 2004

Re: Apache::Test question
Geoffrey Young 23:39 on 16 Dec 2004

Re: Apache::Test question
Torsten Foertsch 15:32 on 19 Dec 2004

Re: Apache::Test question
Stas Bekman 22:34 on 19 Dec 2004

Re: Apache::Test question
Geoffrey Young 23:36 on 16 Dec 2004

Re: Apache::Test question
Stas Bekman 23:49 on 16 Dec 2004

Re: Apache::Test question
Geoffrey Young 00:29 on 17 Dec 2004

Re: Apache::Test question
Stas Bekman 00:41 on 17 Dec 2004

[PATCH]Re: Apache::Test question
Torsten Foertsch 13:41 on 01 May 2005

Generated at 10:25 on 04 May 2005 by mariachi v0.52