On Sun, 12 Aug 2001, Doug MacEachern wrote:

> On Mon, 13 Aug 2001, Stas Bekman wrote:
>
> > I've this:
> >
> > t/modules/PerlRequire.t
> > t/response/TestModules/PerlRequire.pm
>
> if you do 'find t/ -name "*.pm"' you'll see every .pm is lowercase, as are
> all .t files.  the lowercase is also forced as part of the naming
> convention, you know how i like lowercase :)

Yup, but in this case when you run tests modules/PerlRequire makes more
visual sense than modules/perlrequire.

but whichever is fine, I can lowercase these :)

I still get the .t file wiped though.

> > can we add a capability for .pm in t/response to generate things?
> > For example, rather having real parent/PerlRequireTest.pm and
> > vh/PerlRequireTest.pm, I think it'd be much clearer to have them all in
> > .pm file and somehow generated on the fly.
>
> sure.  to make it super generic, how about if a test .pm could have a
> 'sub CONFIGURE {}', which is passed the Apache::TestConfig object when
> configuration is generated?  then you have access to all the directory
> info, gendir(), genfile() and things like that.  the trick would be that
> most .pm tests will currently only run inside the server so for the
> moment you'd need to open the .pm, read in just the CONFIGURE part and
> eval it.

How about differenting between __END__ and __DATA__ and using one for
config part and the second for everything else that can include code:

__END__
<VirtualHost ...>
...
</VirtualHost>

__DATA__

sub CONFIGURE{

#

}

sub CLEANUP{


}

and then we have a freedom of adding new functionality as we want, since
all we have to do is to eval the __DATA__ segment inside the test's
package and then call its function at the various stages of the testing.

> > My perfect vision of a test is having everything in one file: .t, .pm and
> > any other parts, which makes it super easy to write new tests,
> > perception-wise. But of course harder to debug, so probably it's not an
> > option.
>
> i very much like having one .t and one .pm too.  hopefully in the long run
> will make things easier to debug, once we get all this auto-generated-
> do-exactly-what-i-want stuff right.

:)

_____________________________________________________________________
Stas Bekman              JAm_pH     --   Just Another mod_perl Hacker
http://stason.org/       mod_perl Guide  http://perl.apache.org/guide
mailto:[EMAIL PROTECTED]   http://apachetoday.com http://eXtropia.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to