httpd-test-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <>
Subject Re: Perl test framework, TestConfig, and debugging A::T
Date Sat, 17 Jan 2004 03:26:31 GMT
William McKee wrote:

>>Also you may want to adopt the convention we use for other test suites, 
>>where the response part of the test resides under t/response. So you 
>>usually don't test the module as is, but you create a response handler that 
>>tests it. But it doesn't have to be that way of course.
> OK. FYI, I didn't see anything about this in the docs. I looked at the
> t/ dir in Apache::Test and only see request.t and ping.t. The
> was basically empty. Which other test suites did you have
> in mind?

The 3rd party Apache modules in mine and geoff's CPAN dirs, httpd-test cvs 
repository (same cvs server as modperl-2.0).

>>Now to your issues:
>>> - APACHE_TEST_LIVE_DEV=1 environment
>>>I have written a test in 02_livedev.t which tests this setting and
>>>checks that the first directory in @INC does not contain 'blib'. This
>>>probably isn't a safe test for distribution due to the possibility of
>>>blib being in someone's path. However, I think it is sufficient for
>>>debugging purposes. This test fails on my system.
>>this is because you are testing in the "wrong" place. APACHE_TEST_LIVE_DEV 
>>affects the server, not the client. It adds 'lib' in which 
>>affects the server. You need to write a response part of the test like we 
>>do in all other test suites and test it there.
> So in my case the TEST script that runs my tests is acting as the
> client? 

Exactly. server startup files are the ones affecting the server side.

> I'm not seeing how creating a response handler is going to make
> this work. Is the response handler setup in the or with a
> test?

It will work. Becase APACHE_TEST_LIVE_DEV=1 adds lib to the server's @INC.

>>Yes, I saw that. I think it's a bad idea, since it'll reconfigure the 
>>server every time you run the tests. Usually developers write scripts to 
>>test things, so they can explicitly add -port select if they want to. At 
>>least that's what I do with my tests.
> OK, just thought I'd see if there were a way to automate things a bit.
> What do you mean by the server is reconfigured every time? If I'm
> starting the server on each test, it seems like that would happen
> whether I specified -port select or not.

You could have the APACHE_PORT env variable set to 'select'.

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

View raw message