On Wed, 12 Sep 2001, Doug MacEachern wrote:
> On Tue, 11 Sep 2001, Stas Bekman wrote:
>
> > I need to autogenerate files which are needed during server startup. The
> > test's configure won't be run before the server gets started. It's an egg
> > and chicken problem.
> >
> > So should I try to make all tests require'able outside httpd and get the
> > APACHE_TEST_CONFIGURE working or do you have any other ideas?
> >
> > Of course I can just cvs commit the files, but it makes the test spread
> > out across too many files, and I don't like it.
>
> how about having a list of tests that need APACHE_TEST_CONFIGURE:
>
> my @needs_configure = qw(TestFoo::bar);
>
> and just require those? yeah, it'd be nice not to maintain such a list,
> but considering the number of .pm tests who will have
> APACHE_TEST_CONFIGURE are far less than those without. and we can always
> drop that later if needed.
That doesn't sound good. Changing the build code when a new test is added,
or an old test gets changed. ugly.
OK, how about this.
$run_configure = 0;
while (<IN>) {
$run_configure++, last if m/APACHE_TEST_CONFIGURE/;
}
if ($run_configure) {
require $file;
if ($module->can('APACHE_TEST_CONFIGURE')){
eval { $module->APACHE_TEST_CONFIGURE(); };
warn $@ if $@;
}
}
of course the code is not tested.
_____________________________________________________________________
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]