dougm 02/05/17 19:01:30
Modified: perl-framework/Apache-Test/lib/Apache TestConfigPerl.pm
Log:
allow perl .pm tests to override Perl*Handler config
Revision Changes Path
1.52 +16 -7
httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfigPerl.pm
Index: TestConfigPerl.pm
===================================================================
RCS file:
/home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfigPerl.pm,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -r1.51 -r1.52
--- TestConfigPerl.pm 14 May 2002 21:53:51 -0000 1.51
+++ TestConfigPerl.pm 18 May 2002 02:01:30 -0000 1.52
@@ -199,6 +199,8 @@
last if /^(__(DATA|END)__|\#if CONFIG_FOR_HTTPD_TEST)/;
}
+ my %directives;
+
while (<$fh>) {
last if /^\#endif/; #for .c modules
next unless /\S+/;
@@ -211,6 +213,7 @@
next;
}
my($directive, $rest) = split /\s+/, $_, 2;
+ $directives{$directive}++;
$rest = '' unless defined $rest;
if ($outside_container{$directive}) {
$self->postamble($directive => $rest);
@@ -252,6 +255,8 @@
push @$args, $directive, $rest;
}
}
+
+ \%directives;
}
#the idea for each group:
@@ -287,7 +292,7 @@
my $pm = $_;
my $file = catfile $File::Find::dir, $pm;
- $self->add_module_config($file, [EMAIL PROTECTED]);
+ my $directives = $self->add_module_config($file, [EMAIL
PROTECTED]);
my $module = abs2rel $file, $dir;
$module =~ s,\.pm$,,;
$module =~ s/^[a-z]://i; #strip drive if any
@@ -319,13 +324,17 @@
}
my $container = $container_config{$hook} || \&location_container;
- my @handler_cfg = ($handler => $module);
- if ($outside_container{$handler}) {
- $self->postamble(@handler_cfg);
- }
- else {
- push @args, @handler_cfg;
+ #unless the .pm test already configured the Perl*Handler
+ unless ($directives->{$handler}) {
+ my @handler_cfg = ($handler => $module);
+
+ if ($outside_container{$handler}) {
+ $self->postamble(@handler_cfg);
+ }
+ else {
+ push @args, @handler_cfg;
+ }
}
my $args_hash = list_to_hash_of_lists([EMAIL PROTECTED]);