httpd-test-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject [patch] allow t/conf/foo.pl.in to be autoconfigured
Date Mon, 12 Nov 2001 17:13:57 GMT
in order to test RegistryLoader (unreleased yet) I need to add an extra
startup.pl file, and I need the autoconfiguration's @ServerRoot@ token to
work in this new file. This patch allows to drop into t/conf any file
ending with .in (foo.bar.in) and it'll be converted into foo.bar and run
through tokens substitution. If the file is .conf it will be automatically
loaded via Include, .pl via PerlRequire.

Index: Apache-Test/lib/Apache/TestConfig.pm
===================================================================
RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfig.pm,v
retrieving revision 1.79
diff -u -r1.79 TestConfig.pm
--- Apache-Test/lib/Apache/TestConfig.pm	2001/11/01 18:39:11	1.79
+++ Apache-Test/lib/Apache/TestConfig.pm	2001/11/12 16:55:08
@@ -817,7 +817,7 @@
     my(@extra_conf, @conf_in, @conf_files);

     finddepth(sub {
-        return unless /\.conf\.in$/;
+        return unless /\.in$/;
         push @conf_in, catdir $File::Find::dir, $_;
     }, $self->{vars}->{t_conf});

@@ -895,7 +895,15 @@

     if (my $extra_conf = $self->generate_extra_conf) {
         for my $file (@$extra_conf) {
-            $self->postamble(Include => qq("$file"));
+            if ($file =~ /\.conf$/) {
+                $self->postamble(Include => qq("$file"));
+            }
+            elsif ($file =~ /\.pl$/) {
+                $self->postamble(PerlRequire => qq("$file"));
+            }
+            else {
+                # nothing yet
+            }
         }
     }

_____________________________________________________________________
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