[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mason-cvs
Subject:    [Mason-checkins] CVS: mason/dist/t 08-ah.t,1.78,1.79
From:       John Williams <sharkey3 () users ! sourceforge ! net>
Date:       2005-05-29 1:57:09
Message-ID: E1DcD37-0005e7-9t () sc8-pr-cvs1 ! sourceforge ! net
[Download RAW message or body]

Update of /cvsroot/mason/mason/dist/t
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20824/t

Modified Files:
	08-ah.t 
Log Message:
mod_perl2 renaming: check both $mod_perl2::VERSION and $mod_perl::VERSION
other Apache2::* fixes


Index: 08-ah.t
===================================================================
RCS file: /cvsroot/mason/mason/dist/t/08-ah.t,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -r1.78 -r1.79
--- 08-ah.t	7 Jan 2005 03:35:34 -0000	1.78
+++ 08-ah.t	29 May 2005 01:57:05 -0000	1.79
@@ -7,11 +7,16 @@
 my $test_data = Module::Build->current->notes('test_data');
 
 # Skip test if no mod_perl
-eval { require mod_perl };
+eval { require mod_perl2 };
+if ($@) { eval { require mod_perl } };
+my $mpver;
+{
+  no warnings 'once';
+  $mpver = ($mod_perl2::VERSION || $mod_perl::VERSION);
+};
+my $apreq_module = $mpver >= 2 ? 'Apache2::Request' : 'Apache::Request';
 
-unless ( $test_data->{is_maintainer} &&
-# need to use var name twice to avoid annoying warning
-         ( $mod_perl::VERSION || $mod_perl::VERSION ) )
+unless ( $test_data->{is_maintainer} && $mpver )
 {
     print "1..0\n";
     exit;
@@ -37,11 +42,11 @@
 test_load_apache();
 
 my $tests = 19; # multi conf & taint tests
-$tests += 60 if my $have_libapreq = have_module('Apache::Request');
+$tests += 60 if my $have_libapreq = have_module($apreq_module);
 $tests += 40 if my $have_cgi      = have_module('CGI');
 $tests += 15 if my $have_tmp      = (-d '/tmp' and -w '/tmp');
 $tests++ if $have_cgi;
-$tests++ if my $have_filter = (have_module('Apache::Filter') && \
Apache::Filter->VERSION >= 1.021 && $mod_perl::VERSION < 1.99); +$tests++ if my \
$have_filter = (have_module('Apache::Filter') && Apache::Filter->VERSION >= 1.021 && \
$mpver < 1.99);  
 plan( tests => $tests);
 
@@ -151,7 +156,7 @@
 	      );
 
     write_comp( 'apache_request', <<'EOF',
-% if ($r->isa('Apache::Request')) {
+% if ($r->isa('Apache::Request') || $r->isa('Apache2::Request')) {
 Apache::Request
 % }
 EOF
@@ -248,7 +253,7 @@
 
     write_comp( 'internal_redirect', <<'EOF',
 <%init>
-if ($mod_perl::VERSION >= 1.99) { require Apache::SubRequest; }
+if ($mod_perl2::VERSION >= 2.00) { require Apache2::SubRequest; }
 $r->internal_redirect('/comps/internal_redirect_target?foo=17');
 $m->auto_send_headers(0);
 $m->clear_buffer;



-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
_______________________________________________
Mason-checkins mailing list
Mason-checkins@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-checkins


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic