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 co...@apache.org on 2006/01/27 00:45:01 UTC

svn commit: r372663 - /perl/Apache-Test/trunk/lib/Apache/Test.pm

Author: colm
Date: Thu Jan 26 15:44:59 2006
New Revision: 372663

URL: http://svn.apache.org/viewcvs?rev=372663&view=rev
Log:
Revert most of r371931, as it currently breaks the test suite. need_php
in particular is returning success when it shouldn't be.

Modified:
    perl/Apache-Test/trunk/lib/Apache/Test.pm

Modified: perl/Apache-Test/trunk/lib/Apache/Test.pm
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/trunk/lib/Apache/Test.pm?rev=372663&r1=372662&r2=372663&view=diff
==============================================================================
--- perl/Apache-Test/trunk/lib/Apache/Test.pm (original)
+++ perl/Apache-Test/trunk/lib/Apache/Test.pm Thu Jan 26 15:44:59 2006
@@ -348,27 +348,27 @@
 }
 
 sub need_cgi {
-    return _need_multi(qw(cgi cgid));
+    return need_module("cgi") || need_module("cgid");
 }
 
 sub need_php {
-    return _need_multi(qw(php4 php5 sapi_apache2.c));
+    return need_module("php4") || need_module("php5") || need_module("sapi_apache2.c");
 }
 
 sub need_php4 {
-    return _need_multi(qw(php4 php5));
+    return need_module("php4") || need_module("php5");
 }
 
 sub need_access {
-    return _need_multi(qw(access authz_host));
+    return need_module("access") || need_module("authz_host");
 }
 
 sub need_auth {
-    return _need_multi(qw(auth auth_basic));
+    return need_module("auth") || need_module("auth_basic");
 }
 
 sub need_imagemap {
-    return _need_multi(qw(imagemap imap));
+    return need_module("imagemap") || need_module("imap");
 }
 
 sub _need_multi {
@@ -376,16 +376,19 @@
     my $reason = join ' or ', @need;
     my $rc;
 
+    for (@need)
     {
         local @SkipReasons;
 
-        $rc = grep { need_module($_) } @need;
+        if (need_module($_)) {
+	    return 1;
+        }
     }
-
+    
     push @SkipReasons, "cannot find one of $reason"
         unless $rc;
 
-    return $rc;     
+    return 0;     
 }
 
 sub need_apache {



Re: svn commit: r372663 - /perl/Apache-Test/trunk/lib/Apache/Test.pm

Posted by Geoffrey Young <ge...@modperlcookbook.org>.

Colm MacCarthaigh wrote:
> On Thu, Jan 26, 2006 at 09:57:28PM -0500, Geoffrey Young wrote:
> 
>>hmph.  I'm sorry you had to go through all that, but next time just speak up
> 
> 
> I didn't know where to :) 

you're probably not alone - the lists have recently changed.

> I was actually surprised I could commit to it,

here's the history...

Apache-Test started as part of the mp2 project.  then the httpd-test project
was started (owned by httpd) and Apache-Test spun off as the engine for the
perl-framework under httpd-test.  then more things got added to httpd-test
and only mod_perl people were working on Apache-Test proper anyway, so last
year we took it back over under our project.  but all the original
committers to httpd-test (all of httpd) were allowed to keep their commit
privs to Apache-Test, kind of as a courtesy.

note that A-T is actually a separate project using svn externals on checkout
of httpd-test:

  http://svn.apache.org/repos/asf/perl/Apache-Test/

> and then I thought dev@httpd was the place for discussion and assumed it
> was dead. It was only later that I found this list, so my bad.

no, that's ok.  Apache-Test was given its own list (this one) when we took
it back over last year, making two lists - one for A-T and one for the rest
of httpd-test (the now dead test-dev@httpd).  then maybe last month justin
retired test-dev@httpd and moved discussion over to httpd.

so, the way things stand now, A-T probems/issues/discussion should happen
here, while the rest of httpd-test (including perl-framework/t) should
happen on httpd.  the idea was to get the real httpd tests discussed in the
right place, while still keeping the perl engine (A-T) visible and
maintained by the ASF people that know perl the best (and who happen to be
the nearly sole creators and maintaners of it, since we use it for the mp2
test suite and maintain a separate distribtion of just A-T).

> 
> 
>>- I would have happily worked on fixing it rather than have you go through a
>>few different iterations trying to make it work then backing the whole thing
>>out.  sorry I don't follow new-httpd as much as I should...
> 
> 
> I'll update our docs later to be more clear on where things are tracked,
> here is a fine place, I don't think you should have to track  the httpd
> list, it's pretty noisy!

:)

if you document that perl-framework/Apache-Test is really a separate project
in and of itself, under the direction of the perl pmc, and has its own
mailing list it should be a bit more clear.

really, I'd like to restrict commit access to just mod_perl folks (extended
to httpd people that have contributed and understand the project), or at
least ask that non-familiar-with-the-project folks follow RTC, since nobody
seems to enjoy coding perl quite as much as we do :)  but I don't want to
offend anyone either.

> 
> 
>>anyway, the problem was mostly a variable stomping issue.  but with php in
>>particular it was a cut and paste error: need_php4 was checking for php4 or
>>php5 instead of php4 and sapi_apache.c.  and that was even carried over to
>>the current version as well ;)
>>
>>so, should be all fixed now, so give it another whirl.
> 
> 
> Yep, no more errors or dubious results.

excellent.

> 
> 
>>oh, I tweaked need_imagemap a bit for you and added a brief doc while I was
>>at it ;)
> 
> 
> Thank you very much!

sure.  just for your own knowledge there exists two sets of testing methods
- need_* and have_* - such that things like need_imagemap() ought to have a
have_imagemap() counterpart.  the difference is that need_imagemap()
populates the skip message so can be used with plan(), while have_imagemap()
performs the exact same check without populating the skip message.  the net
result is that you can use have_imagemap() anywhere in your test code to
skip individual tests without affecting the overall skip message.

anyway, so every time you implement a need_* function you ought to do have_*
as well.  luckily the have_* counterparts are automagically created - all
you need to do is populate the @need array at the top of Test.pm with the
name of your new method.

just FYI if you're interested :)

--Geoff

Re: svn commit: r372663 - /perl/Apache-Test/trunk/lib/Apache/Test.pm

Posted by Colm MacCarthaigh <co...@stdlib.net>.
On Thu, Jan 26, 2006 at 09:57:28PM -0500, Geoffrey Young wrote:
> hmph.  I'm sorry you had to go through all that, but next time just speak up

I didn't know where to :) I was actually surprised I could commit to it,
and then I thought dev@httpd was the place for discussion and assumed it
was dead. It was only later that I found this list, so my bad.

> - I would have happily worked on fixing it rather than have you go through a
> few different iterations trying to make it work then backing the whole thing
> out.  sorry I don't follow new-httpd as much as I should...

I'll update our docs later to be more clear on where things are tracked,
here is a fine place, I don't think you should have to track  the httpd
list, it's pretty noisy!

> anyway, the problem was mostly a variable stomping issue.  but with php in
> particular it was a cut and paste error: need_php4 was checking for php4 or
> php5 instead of php4 and sapi_apache.c.  and that was even carried over to
> the current version as well ;)
> 
> so, should be all fixed now, so give it another whirl.

Yep, no more errors or dubious results.

> oh, I tweaked need_imagemap a bit for you and added a brief doc while I was
> at it ;)

Thank you very much!

-- 
Colm MacCárthaigh                        Public Key: colm+pgp@stdlib.net

Re: svn commit: r372663 - /perl/Apache-Test/trunk/lib/Apache/Test.pm

Posted by Geoffrey Young <ge...@modperlcookbook.org>.
hi colm :)

colm@apache.org wrote:
> Author: colm
> Date: Thu Jan 26 15:44:59 2006
> New Revision: 372663
> 
> URL: http://svn.apache.org/viewcvs?rev=372663&view=rev
> Log:
> Revert most of r371931, as it currently breaks the test suite. need_php
> in particular is returning success when it shouldn't be.

hmph.  I'm sorry you had to go through all that, but next time just speak up
- I would have happily worked on fixing it rather than have you go through a
few different iterations trying to make it work then backing the whole thing
out.  sorry I don't follow new-httpd as much as I should...

anyway, the problem was mostly a variable stomping issue.  but with php in
particular it was a cut and paste error: need_php4 was checking for php4 or
php5 instead of php4 and sapi_apache.c.  and that was even carried over to
the current version as well ;)

so, should be all fixed now, so give it another whirl.

oh, I tweaked need_imagemap a bit for you and added a brief doc while I was
at it ;)

--Geoff