Author: stas
Date: Mon Jan 10 08:24:21 2005
New Revision: 124809

URL: http://svn.apache.org/viewcvs?view=rev&rev=124809
Log:
Apache::TestConfig::should_skip_module now works with regex
patterns.

Modified:
   httpd/test/trunk/perl-framework/Apache-Test/Changes
   httpd/test/trunk/perl-framework/Apache-Test/lib/Apache/TestConfigParse.pm

Modified: httpd/test/trunk/perl-framework/Apache-Test/Changes
Url: 
http://svn.apache.org/viewcvs/httpd/test/trunk/perl-framework/Apache-Test/Changes?view=diff&rev=124809&p1=httpd/test/trunk/perl-framework/Apache-Test/Changes&r1=124808&p2=httpd/test/trunk/perl-framework/Apache-Test/Changes&r2=124809
==============================================================================
--- httpd/test/trunk/perl-framework/Apache-Test/Changes (original)
+++ httpd/test/trunk/perl-framework/Apache-Test/Changes Mon Jan 10 08:24:21 2005
@@ -8,6 +8,11 @@
 
 =item 1.20-dev
 
+Apache::TestConfig::should_skip_module now works with regex
+patterns. [Stas]
+
+
+
 =item 1.19 - January 5, 2005
 
 Test for module.c instead of module.so for IfModule in

Modified: 
httpd/test/trunk/perl-framework/Apache-Test/lib/Apache/TestConfigParse.pm
Url: 
http://svn.apache.org/viewcvs/httpd/test/trunk/perl-framework/Apache-Test/lib/Apache/TestConfigParse.pm?view=diff&rev=124809&p1=httpd/test/trunk/perl-framework/Apache-Test/lib/Apache/TestConfigParse.pm&r1=124808&p2=httpd/test/trunk/perl-framework/Apache-Test/lib/Apache/TestConfigParse.pm&r2=124809
==============================================================================
--- httpd/test/trunk/perl-framework/Apache-Test/lib/Apache/TestConfigParse.pm   
(original)
+++ httpd/test/trunk/perl-framework/Apache-Test/lib/Apache/TestConfigParse.pm   
Mon Jan 10 08:24:21 2005
@@ -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

Reply via email to