You are viewing a plain text version of this content. The canonical link for it is here.
Posted to test-commits@perl.apache.org by ge...@apache.org on 2006/01/27 03:56:06 UTC
svn commit: r372706 - in /perl/Apache-Test/trunk: Changes lib/Apache/Test.pm
Author: geoff
Date: Thu Jan 26 18:56:01 2006
New Revision: 372706
URL: http://svn.apache.org/viewcvs?rev=372706&view=rev
Log:
fix _need_multi()
document need_imagemap()
add have_imagemap()
Modified:
perl/Apache-Test/trunk/Changes
perl/Apache-Test/trunk/lib/Apache/Test.pm
Modified: perl/Apache-Test/trunk/Changes
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/trunk/Changes?rev=372706&r1=372705&r2=372706&view=diff
==============================================================================
--- perl/Apache-Test/trunk/Changes (original)
+++ perl/Apache-Test/trunk/Changes Thu Jan 26 18:56:01 2006
@@ -8,6 +8,9 @@
=item 1.28-dev
+add need_imagemap() and have_imagemap() to check for mod_imap
+or mod_imagemap [ Colm MacCárthaigh ]
+
shortcuts like need_cgi() and need_php() no longer spit out
bogus skip messages [Geoffrey Young]
Modified: perl/Apache-Test/trunk/lib/Apache/Test.pm
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/trunk/lib/Apache/Test.pm?rev=372706&r1=372705&r2=372706&view=diff
==============================================================================
--- perl/Apache-Test/trunk/lib/Apache/Test.pm (original)
+++ perl/Apache-Test/trunk/lib/Apache/Test.pm Thu Jan 26 18:56:01 2006
@@ -348,23 +348,23 @@
}
sub need_cgi {
- return need_module("cgi") || need_module("cgid");
+ return _need_multi(qw(cgi cgid));
}
sub need_php {
- return need_module("php4") || need_module("php5") || need_module("sapi_apache2.c");
+ return _need_multi(qw(php4 php5 sapi_apache2.c));
}
sub need_php4 {
- return need_module("php4") || need_module("php5");
+ return _need_multi(qw(php4 sapi_apache2.c));
}
sub need_access {
- return need_module("access") || need_module("authz_host");
+ return _need_multi(qw(access authz_host));
}
sub need_auth {
- return need_module("auth") || need_module("auth_basic");
+ return _need_multi(qw(auth auth_basic));
}
sub need_imagemap {
@@ -372,23 +372,25 @@
}
sub _need_multi {
- my @need = @_;
- my $reason = join ' or ', @need;
- my $rc;
- for (@need)
+ my @check = @_;
+
+ my $rc = 0;
+
{
local @SkipReasons;
- if (need_module($_)) {
- return 1;
+ foreach my $module (@check) {
+ $rc ||= need_module($module);
}
}
-
+
+ my $reason = join ' or ', @check;
+
push @SkipReasons, "cannot find one of $reason"
unless $rc;
- return 0;
+ return $rc;
}
sub need_apache {
@@ -735,6 +737,12 @@
plan tests => 5, need_php4;
Requires a PHP version 4 module to be installed.
+
+=item need_imagemap
+
+ plan tests => 5, need_imagemap;
+
+Requires a mod_imagemap or mod_imap be installed
=item need_apache