Return-Path: Delivered-To: apmail-httpd-test-dev-archive@www.apache.org Received: (qmail 59114 invoked from network); 6 Jan 2005 18:39:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 6 Jan 2005 18:39:44 -0000 Received: (qmail 15747 invoked by uid 500); 6 Jan 2005 18:39:44 -0000 Delivered-To: apmail-httpd-test-dev-archive@httpd.apache.org Received: (qmail 15722 invoked by uid 500); 6 Jan 2005 18:39:44 -0000 Mailing-List: contact test-dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: test-dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list test-dev@httpd.apache.org Received: (qmail 15708 invoked by uid 99); 6 Jan 2005 18:39:43 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from mail.logilune.com (HELO mail.logilune.com) (195.80.154.36) by apache.org (qpsmtpd/0.28) with ESMTP; Thu, 06 Jan 2005 10:39:43 -0800 Received: from [127.0.0.1] (localhost.logilune.com [127.0.0.1]) by mail.logilune.com (Postfix) with ESMTP id 4AFC71E19D1; Thu, 6 Jan 2005 19:39:40 +0100 (CET) Message-ID: <41DD85EB.2080005@stason.org> Date: Thu, 06 Jan 2005 13:39:39 -0500 From: Stas Bekman Organization: Hope, Humanized User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041217 X-Accept-Language: en-us, en, he, ru MIME-Version: 1.0 To: test-dev@httpd.apache.org Cc: Nick *** Subject: Re: [A-T patch] changing should_skip_module to support regex skip patterns References: <472579070.1105015887086.JavaMail.nobody@app4.ni.bg> <41DD7C1B.2050108@stason.org> <41DD8514.4050001@modperlcookbook.org> In-Reply-To: <41DD8514.4050001@modperlcookbook.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N 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