httpd-test-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: More basics on the perl-framework stuff..
Date Thu, 13 Dec 2001 06:52:11 GMT
Doug MacEachern wrote:

> On Thu, 13 Dec 2001, Stas Bekman wrote:
> 
> 
>>agreed, but the other suggestion to check the first line of .t is too 
>>restrictive.
>>
> 
> how so?  the first line thing is just to say 'scan this file'.  if the
> magic isn't on the first line, the file isn't scanned.

I guess 'restrictive' wasn't the right word. I've a gut feeling that 
test writers will not remember that it must be a first line and there 
will be no warnings that they've done it wrong (e.g. put it as a seconf 
line). Oh well.

 
>>Also when you want to get to the CONFIGURE section you have to require() 
>>the file, which means it'll run the code in it, which is not good. 
>>(compare with .pm, where everything is made of functions).
>>
> 
> right.  so we do it different from .pm's and just eval the 'sub CONFIGURE
> {...}' part.  and for good luck, as part of the eval we can toss in:
> use Apache::Test;
> use Apache::TestUtil;
> etc.
> 
> if the CONFIGURE sub needs anything else, it can 'require' it.  no more
> painful to the user than having it another file.


ok.

I was thinking that the best solution would be to encode the need for 
scanning a certain file in its name. e.g. foo.conf.t or foo.c.t, foo.ct 
(like this one the best since it won't appear in the tests stats 
output), so you still have one file and no need to open the files at 
all. The only caveat is if you decide to add the config part to an 
existing test you have to re-name it in cvs, plus MANIFEST file. Not 
sure which of the evils is less of an evil :)

 
>>Also notice that Ken's request is different from what CONFIGURE does. 
>>CONFIGURE doesn't add stuff to .conf, the __DATA__ section does. 
>>
> 
> i know that.  i brought CONFIGURE into the conversation because if we're
> going to scan .t's for __DATA__ we might as well look for CONFIGURE too
> while we're there.

got it now.


_____________________________________________________________________
Stas Bekman             JAm_pH      --   Just Another mod_perl Hacker
http://stason.org/      mod_perl Guide   http://perl.apache.org/guide
mailto:stas@stason.org  http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/


Mime
View raw message