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: Test::More server support redux
Date Thu, 05 Aug 2004 18:27:12 GMT

>> +Note that I<Test::Builder> 0.18_01, available in I<Test::Simple>
>> +version 0.48_01 on CPAN, is required to use this feature.
> 
> 
> drop that, as 2 copies of the same thing in different places will go out
> of sync at some point. check on the code level should be sufficient.
> instead the error message could say where to find the required version.

well, maybe it's not clear - colloquially most people I've talked to refer
to Test::More.  but Test::More isn't a distribution, it's part of
Test::Simple (as is Test::Builder).

anyway, I'll know more about the module versions when Test::Simple 0.49 is
released - if all the versions of the underlying packages are correct I'll
just require 0.49 and be done with it.

>> -    my $lib = catfile Apache::Test::vars('top_dir'), qw(Apache-Test
>> lib);
>> -    my $cmd = qq[$^X -Mlib="$lib" $file];
>> +    # so we can find Apache/Test.pm from both the perl-framework
>> +    # and Apache-Test.  note that IS_APACHE_TEST_BUILD returns
>> +    # true for the perl-framework as well
>> +    my $lib = join ':',
>> +        catfile(Apache::Test::vars('top_dir'), qw(Apache-Test lib)),
>> +        catfile(Apache::Test::vars('top_dir'), 'lib');
>> +    my $cmd = qq[PERL5LIB="$lib" $^X $file];
> 
> 
> why this change? is there anything wrong with -Mlib? 

yes.  the problem is that currently all.t does not get run properly from
Apache-Test/.  the current code adds makes @INC look like
perl-framework/Apache-Test/Apache-Test/lib when running from the A-T directory.

> PERL5LIB will be
> ignored under -T -- code will be broken.

yes, but it shouldn't be a problem, since $lib is only important if A-T
can't be found, which is presumably only when running from the
perl-framework/ or Apache-Test/ directories.  which is why I have my comment
that IS_APACHE_TEST_BUILD is insufficient to determine whether it is a real
A-T build or someone running from the perl-framework.

>> +
>> +<IfModule mod_perl.c>
>> +  <IfDefine APACHE2>
>> +    PerlModule Apache2
>> +  </IfDefine>
> 
> 
> why not put the stuff below into extra.last.conf.in. Apache2 will be
> loaded by then. It's better not to mess with Apache2 before times.

because unless I use TestRunPerl (over TestRun) nothing mod_perl will be set
up, including Apache2.  so it's not a matter of timing, but rather if
Apache2 is loaded at all.

>> +use Apache::TestRequest 'GET_BODY_ASSERT';
>> +print GET_BODY_ASSERT "/TestMore__testmorepm";
> 
> 
> hmm, what are you trying to achieve with repeating two tests twice? what
> if you don't hit the same interpreter if that's what you are after? 

the reason they are run twice (and in alternating Test.pm and Test::More
order) is that when I first coded it there was a bug in that Test::More
would never release itself from the tests due to some global variables.
0.49 addresses this with an official API for persistent environments, which
I can now call (and is why we can't use any earlier versions).

so, yes, I suppose it is an interpreter issue.

> It's probably better to use 1 test and run the same_interprter framework?

well, the multiple test calls are to make sure that users can intermix
Test.pm and Test::More plans on the server, so I clearly want multiple tests
and not just one if I'm going to mimic user activity.  but I'll look into
using same_interpreter to make sure that threaded mpms work properly as well.

>> +  0;
> 
> 
> What's 0? Should it be Apache::OK?

sure.

--Geoff

Mime
View raw message