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:[EMAIL PROTECTED] 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

Reply via email to