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: [A-T patch] changing should_skip_module to support regex skip patterns
Date Thu, 06 Jan 2005 18:39:39 GMT
Geoffrey Young wrote:
> 
> Stas Bekman wrote:
> 
>>As you can see from the email below, some modules embed a version number
>>in the module 'mod_fastcgi-2.4.2-AP20.dll'. Our should_skip_module only
>>matches an exact name. The patch at the end of this email extends the
>>functionality to support regex skip arguments. Let me know if you have
>>any objections to this change.
> 
> 
> +1
> 
> 
>>+        $name =~ s/\.(s[ol]|dll)$/.c/;  #mod_info.so => mod_info.c
>>+        $name =~ s/\.dll$/.c/;  #mod_info.so => mod_info.c

Thanks for the catch. How about this:

Index: lib/ModPerl/TestRun.pm
===================================================================
--- lib/ModPerl/TestRun.pm	(revision 124346)
+++ lib/ModPerl/TestRun.pm	(working copy)
@@ -64,12 +64,9 @@

  # - don't inherit LoadModule perl_module from the apache httpd.conf
  # - loaded fastcgi crashes some mp2 tests
-my %skip = map { ("mod_$_.c" => 1) } qw(perl fastcgi);
-sub should_skip_module {
-    my($self, $name) = @_;
+my @skip = ('mod_perl.c', qr/mod_fastcgi.*?\.c$/);

-    exists $skip{$name} ? 1 : $self->SUPER::should_skip_module($name);
-}
+Apache::TestConfig::autoconfig_skip_module_add(@skip);

  1;
Index: Apache-Test/lib/Apache/TestConfigParse.pm
===================================================================
--- Apache-Test/lib/Apache/TestConfigParse.pm	(revision 124346)
+++ Apache-Test/lib/Apache/TestConfigParse.pm	(working copy)
@@ -162,20 +162,28 @@
  #XXX mod_jk requires JkWorkerFile or JkWorker to be configured
  #skip it for now, tomcat has its own test suite anyhow.
  #XXX: mod_casp2.so requires other settings in addition to LoadModule
-my %autoconfig_skip_module = map { $_, 1 } qw(mod_jk.c mod_casp2.c);
+my @autoconfig_skip_module = qw(mod_jk.c mod_casp2.c);

  # add modules to be not inherited from the existing config.
  # e.g. prevent from LoadModule perl_module to be included twice, when
  # mod_perl already configures LoadModule and it's certainly found in
  # the existing httpd.conf installed system-wide.
  sub autoconfig_skip_module_add {
-    my($name) = @_;
-    $autoconfig_skip_module{$name} = 1;
+    push @autoconfig_skip_module, @_;
  }

  sub should_skip_module {
      my($self, $name) = @_;
-    return $autoconfig_skip_module{$name} ? 1 : 0;
+
+    for (@autoconfig_skip_module) {
+        if (UNIVERSAL::isa($_, 'Regexp')) {
+            return 1 if $name =~ /$_/;
+        }
+        else {
+            return 1 if $name eq $_;
+        }
+    }
+    return 0;
  }

  #inherit LoadModule
@@ -192,7 +200,7 @@
          }

          my $name = basename $args->[1];
-        $name =~ s/\.s[ol]$/.c/;  #mod_info.so => mod_info.c
+        $name =~ s/\.(s[ol]|dll)$/.c/;  #mod_info.so => mod_info.c
          $name =~ s/^lib/mod_/; #libphp4.so => mod_php4.c

          $name = $modname_alias{$name} if $modname_alias{$name};


-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

Mime
View raw message