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 2005/03/30 20:48:48 UTC

svn commit: r159505 - in perl/Apache-Test/trunk: ./ Apache-TestItSelf/ Apache-TestItSelf/Apache-TestMe/ Apache-TestItSelf/Apache-TestMe/t/response/TestBasic/ Apache-TestItSelf/sample/ lib/Apache/ t/conf/

Author: geoff
Date: Wed Mar 30 10:48:44 2005
New Revision: 159505

URL: http://svn.apache.org/viewcvs?view=rev&rev=159505
Log:
merge apache2-rename-unstable to trunk

Modified:
    perl/Apache-Test/trunk/Apache-TestItSelf/Apache-TestMe/Changes
    perl/Apache-Test/trunk/Apache-TestItSelf/Apache-TestMe/Makefile.PL
    perl/Apache-Test/trunk/Apache-TestItSelf/Apache-TestMe/t/response/TestBasic/Hello.pm
    perl/Apache-Test/trunk/Apache-TestItSelf/Apache-TestMe/t/response/TestBasic/Vhost.pm
    perl/Apache-Test/trunk/Apache-TestItSelf/Changes
    perl/Apache-Test/trunk/Apache-TestItSelf/sample/testitself_conf_mp2_core.pl
    perl/Apache-Test/trunk/Changes
    perl/Apache-Test/trunk/lib/Apache/Test.pm
    perl/Apache-Test/trunk/lib/Apache/TestConfig.pm
    perl/Apache-Test/trunk/lib/Apache/TestConfigPerl.pm
    perl/Apache-Test/trunk/lib/Apache/TestHandler.pm
    perl/Apache-Test/trunk/lib/Apache/TestMB.pm
    perl/Apache-Test/trunk/lib/Apache/TestMM.pm
    perl/Apache-Test/trunk/lib/Apache/TestReport.pm
    perl/Apache-Test/trunk/lib/Apache/TestRun.pm
    perl/Apache-Test/trunk/lib/Apache/TestRunPerl.pm
    perl/Apache-Test/trunk/lib/Apache/TestSmoke.pm
    perl/Apache-Test/trunk/t/conf/extra.conf.in

Modified: perl/Apache-Test/trunk/Apache-TestItSelf/Apache-TestMe/Changes
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/trunk/Apache-TestItSelf/Apache-TestMe/Changes?view=diff&r1=159504&r2=159505
==============================================================================
--- perl/Apache-Test/trunk/Apache-TestItSelf/Apache-TestMe/Changes (original)
+++ perl/Apache-Test/trunk/Apache-TestItSelf/Apache-TestMe/Changes Wed Mar 30 10:48:44 2005
@@ -18,4 +18,4 @@
 
 =back
 
-=cut
\ No newline at end of file
+=cut

Modified: perl/Apache-Test/trunk/Apache-TestItSelf/Apache-TestMe/Makefile.PL
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/trunk/Apache-TestItSelf/Apache-TestMe/Makefile.PL?view=diff&r1=159504&r2=159505
==============================================================================
--- perl/Apache-Test/trunk/Apache-TestItSelf/Apache-TestMe/Makefile.PL (original)
+++ perl/Apache-Test/trunk/Apache-TestItSelf/Apache-TestMe/Makefile.PL Wed Mar 30 10:48:44 2005
@@ -38,7 +38,6 @@
 
 }
 else {
-    require Apache2;
     require ModPerl::MM;
     ModPerl::MM::WriteMakefile(
         %common_opts,
@@ -80,16 +79,14 @@
     }
     elsif ($wanted == 2) {
         #warn "Looking for mod_perl 2.0";
-        require Apache2;
-        require_mod_perl();
+        require_mod_perl2();
         if ($mod_perl::VERSION < 1.99) {
             die "You don't seem to have mod_perl 2.0 installed";
         }
         $selected = 2;
     }
     else {
-        require_mod_perl();
-        $selected = $mod_perl::VERSION >= 1.99 ? 2 : 1;
+        $selected = eval { require_mod_perl2() or require_mod_perl() };
         warn "Using $mod_perl::VERSION\n";
     }
 
@@ -99,6 +96,13 @@
 sub require_mod_perl {
     eval { require mod_perl };
     die "Can't find mod_perl installed\nThe error was: $@" if $@;
+    1;
+}
+
+sub require_mod_perl2 {
+    eval { require mod_perl2 };
+    die "Can't find mod_perl installed\nThe error was: $@" if $@;
+    2;
 }
 
 
@@ -149,7 +153,7 @@
 
     unless ($wanted) {
         # if still unknown try to require mod_perl.pm
-        eval { require mod_perl };
+        eval { require mod_perl2 or require mod_perl };
         unless ($@) {
             $wanted = $mod_perl::VERSION >= 1.99 ? 2 : 1;
         }
@@ -206,7 +210,7 @@
 
     unless ($wanted) {
         # if still unknown try to require mod_perl.pm
-        eval { require mod_perl };
+        eval { require mod_perl2 or require mod_perl };
         unless ($@) {
             $wanted = $mod_perl::VERSION >= 1.99 ? 2 : 1;
         }

Modified: perl/Apache-Test/trunk/Apache-TestItSelf/Apache-TestMe/t/response/TestBasic/Hello.pm
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/trunk/Apache-TestItSelf/Apache-TestMe/t/response/TestBasic/Hello.pm?view=diff&r1=159504&r2=159505
==============================================================================
--- perl/Apache-Test/trunk/Apache-TestItSelf/Apache-TestMe/t/response/TestBasic/Hello.pm (original)
+++ perl/Apache-Test/trunk/Apache-TestItSelf/Apache-TestMe/t/response/TestBasic/Hello.pm Wed Mar 30 10:48:44 2005
@@ -1,8 +1,8 @@
 package TestBasic::Hello;
 
-use Apache::RequestRec ();
-use Apache::RequestIO ();
-use Apache::Const -compile => qw(OK);
+use Apache2::RequestRec ();
+use Apache2::RequestIO ();
+use Apache2::Const -compile => qw(OK);
 
 # XXX: adjust the test that it'll work under mp1 as well
 
@@ -13,7 +13,7 @@
   $r->content_type('text/plain');
   $r->print('Hello');
 
-  return Apache::OK;
+  return Apache2::OK;
 }
 
 1;

Modified: perl/Apache-Test/trunk/Apache-TestItSelf/Apache-TestMe/t/response/TestBasic/Vhost.pm
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/trunk/Apache-TestItSelf/Apache-TestMe/t/response/TestBasic/Vhost.pm?view=diff&r1=159504&r2=159505
==============================================================================
--- perl/Apache-Test/trunk/Apache-TestItSelf/Apache-TestMe/t/response/TestBasic/Vhost.pm (original)
+++ perl/Apache-Test/trunk/Apache-TestItSelf/Apache-TestMe/t/response/TestBasic/Vhost.pm Wed Mar 30 10:48:44 2005
@@ -1,6 +1,6 @@
 package TestBasic::Vhost;
 
-use Apache::Const -compile => qw(OK);
+use Apache2::Const -compile => qw(OK);
 use Apache::Test;
 
 # XXX: adjust the test that it'll work under mp1 as well
@@ -13,7 +13,7 @@
 
   ok 1;
 
-  return Apache::OK;
+  return Apache2::OK;
 }
 
 1;

Modified: perl/Apache-Test/trunk/Apache-TestItSelf/Changes
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/trunk/Apache-TestItSelf/Changes?view=diff&r1=159504&r2=159505
==============================================================================
--- perl/Apache-Test/trunk/Apache-TestItSelf/Changes (original)
+++ perl/Apache-Test/trunk/Apache-TestItSelf/Changes Wed Mar 30 10:48:44 2005
@@ -24,4 +24,4 @@
 
 =back
 
-=cut
\ No newline at end of file
+=cut

Modified: perl/Apache-Test/trunk/Apache-TestItSelf/sample/testitself_conf_mp2_core.pl
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/trunk/Apache-TestItSelf/sample/testitself_conf_mp2_core.pl?view=diff&r1=159504&r2=159505
==============================================================================
--- perl/Apache-Test/trunk/Apache-TestItSelf/sample/testitself_conf_mp2_core.pl (original)
+++ perl/Apache-Test/trunk/Apache-TestItSelf/sample/testitself_conf_mp2_core.pl Wed Mar 30 10:48:44 2005
@@ -11,7 +11,7 @@
 );
 
 my $path = '/home/stas/httpd';
-my $common_makepl_arg = "MP_INST_APACHE2=1 MP_MAINTAINER=1";
+my $common_makepl_arg = "MP_MAINTAINER=1";
 
 @Apache::TestItSelf::Configs = ();
 for (qw(prefork worker)) {

Modified: perl/Apache-Test/trunk/Changes
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/trunk/Changes?view=diff&r1=159504&r2=159505
==============================================================================
--- perl/Apache-Test/trunk/Changes (original)
+++ perl/Apache-Test/trunk/Changes Wed Mar 30 10:48:44 2005
@@ -8,6 +8,19 @@
 
 =item 1.22-dev
 
+    ******************** IMPORTANT ********************
+      this version of Apache-Test does not completely
+    configure mod_perl for mod_perl versions 1.99_21 or
+    earlier.  Please read the below changes carefully.
+    ***************************************************
+
+remove Apache::TestConfig::modperl_2_inc_fixup().  Apache-Test
+is no longer Apache2.pm aware - it will not configure mod_perl
+support to look in Apache2/ automatically.  [joes]
+
+Add support for mp2's Apache:: -> Apache2:: rename [joes]
+
+
 
 =item 1.21 - March 23, 2005
 

Modified: perl/Apache-Test/trunk/lib/Apache/Test.pm
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/trunk/lib/Apache/Test.pm?view=diff&r1=159504&r2=159505
==============================================================================
--- perl/Apache-Test/trunk/lib/Apache/Test.pm (original)
+++ perl/Apache-Test/trunk/lib/Apache/Test.pm Wed Mar 30 10:48:44 2005
@@ -155,12 +155,12 @@
 sub init_test_pm {
     my $r = shift;
 
-    # needed to load Apache::RequestRec::TIEHANDLE
-    eval {require Apache::RequestIO};
-    if (defined &Apache::RequestRec::TIEHANDLE) {
+    # needed to load Apache2::RequestRec::TIEHANDLE
+    eval {require Apache2::RequestIO};
+    if (defined &Apache2::RequestRec::TIEHANDLE) {
         untie *STDOUT;
         tie *STDOUT, $r;
-        require Apache::RequestRec; # $r->pool
+        require Apache2::RequestRec; # $r->pool
         require APR::Pool;
         $r->pool->cleanup_register(sub { untie *STDOUT });
     }

Modified: perl/Apache-Test/trunk/lib/Apache/TestConfig.pm
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/trunk/lib/Apache/TestConfig.pm?view=diff&r1=159504&r2=159505
==============================================================================
--- perl/Apache-Test/trunk/lib/Apache/TestConfig.pm (original)
+++ perl/Apache-Test/trunk/lib/Apache/TestConfig.pm Wed Mar 30 10:48:44 2005
@@ -28,10 +28,10 @@
 use constant DEFAULT_PORT => 8529;
 
 use constant IS_MOD_PERL_2       =>
-    eval { require mod_perl && $mod_perl::VERSION >= 1.99 } || 0;
+    eval { require mod_perl2 } || 0;
 
 use constant IS_MOD_PERL_2_BUILD => IS_MOD_PERL_2 &&
-    require Apache::Build && Apache::Build::IS_MOD_PERL_BUILD();
+    require Apache2::Build && Apache2::Build::IS_MOD_PERL_BUILD();
 
 use constant IS_APACHE_TEST_BUILD =>
     grep { -e "$_/lib/Apache/TestConfig.pm" } qw(Apache-Test . ..);
@@ -86,7 +86,7 @@
    sbindir         => 'Apache sbin/ dir (default is apxs -q SBINDIR)',
    httpd           => 'server to use for testing (default is $bindir/httpd)',
    target          => 'name of server binary (default is apxs -q TARGET)',
-   apxs            => 'location of apxs (default is from Apache::BuildConfig)',
+   apxs            => 'location of apxs (default is from Apache2::BuildConfig)',
    startup_timeout => 'seconds to wait for the server to start (default is 60)',
    httpd_conf      => 'inherit config from this file (default is apxs derived)',
    httpd_conf_extra=> 'inherit additional config from this file',
@@ -172,10 +172,6 @@
 
 sub server { shift->{server} }
 
-sub modperl_2_inc_fixup {
-    (IS_MOD_PERL_2 && !IS_MOD_PERL_2_BUILD) ? "use Apache2;\n" : '';
-}
-
 sub modperl_build_config {
 
     # we don't want to get mp2 preconfigured data in order to be able
@@ -183,9 +179,9 @@
     return undef if $ENV{APACHE_TEST_INTERACTIVE_CONFIG_TEST};
 
     eval {
-        require Apache::Build;
+        require Apache2::Build;
     } or return undef;
-    return Apache::Build->build_config;
+    return Apache2::Build->build_config;
 }
 
 sub new_test_server {
@@ -2214,8 +2210,8 @@
     {
         my %choices = ();
         my @tries = qw(httpd httpd2);
-        # Win32 uses Apache or perhaps Apache2, not apache/apache2
-        push @tries, WIN32 ? qw(Apache Apache2) : qw(apache apache2);
+        # Win32 uses Apache not apache
+        push @tries, WIN32 ? qw(Apache) : qw(apache);
         for (grep defined $_,
              map({ catfile $vars->{$_}, $vars->{target} } qw(sbindir bindir)),
              $self->default_httpd, which($vars->{target}),

Modified: perl/Apache-Test/trunk/lib/Apache/TestConfigPerl.pm
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/trunk/lib/Apache/TestConfigPerl.pm?view=diff&r1=159504&r2=159505
==============================================================================
--- perl/Apache-Test/trunk/lib/Apache/TestConfigPerl.pm (original)
+++ perl/Apache-Test/trunk/lib/Apache/TestConfigPerl.pm Wed Mar 30 10:48:44 2005
@@ -184,8 +184,6 @@
         if (-d $tlib) {
             print $fh "use lib '$tlib';\n";
         }
-        my $fixup = Apache::TestConfig->modperl_2_inc_fixup();
-        print $fh $fixup;
 
         # if Apache::Test is used to develop a project, we want the
         # project/lib directory to be first in @INC (loaded last)

Modified: perl/Apache-Test/trunk/lib/Apache/TestHandler.pm
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/trunk/lib/Apache/TestHandler.pm?view=diff&r1=159504&r2=159505
==============================================================================
--- perl/Apache-Test/trunk/lib/Apache/TestHandler.pm (original)
+++ perl/Apache-Test/trunk/lib/Apache/TestHandler.pm Wed Mar 30 10:48:44 2005
@@ -20,18 +20,18 @@
 use Apache::Test ();
 use Apache::TestRequest ();
 
-use Apache::Const -compile => qw(OK NOT_FOUND SERVER_ERROR);
+use Apache2::Const -compile => qw(OK NOT_FOUND SERVER_ERROR);
 
 #some utility handlers for testing hooks other than response
 #see modperl-2.0/t/hooks/TestHooks/authen.pm
 
-if ($ENV{MOD_PERL} && require mod_perl && $mod_perl::VERSION > 1.99) {
-    require Apache::RequestIO; # puts
+if ($ENV{MOD_PERL} && require mod_perl2) {
+    require Apache2::RequestIO; # puts
 }
 
 #compat with 1.xx
 my $send_http_header = Apache->can('send_http_header') || sub {};
-my $print = Apache->can('print') || Apache::RequestRec->can('puts');
+my $print = Apache2->can('print') || Apache2::RequestRec->can('puts');
 
 sub ok {
     my $r = shift;
@@ -86,7 +86,7 @@
     }
     elsif ($interp ne $same_interp_id) {
         # this is not the request interpreter instance
-        return Apache::NOT_FOUND;
+        return Apache2::NOT_FOUND;
     }
 
     $same_interp_counter++;
@@ -95,7 +95,7 @@
     # value
     $r->headers_out->set(Apache::TestRequest::INTERP_KEY, $id);
 
-    return Apache::OK;
+    return Apache2::OK;
 }
 
 1;

Modified: perl/Apache-Test/trunk/lib/Apache/TestMB.pm
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/trunk/lib/Apache/TestMB.pm?view=diff&r1=159504&r2=159505
==============================================================================
--- perl/Apache-Test/trunk/lib/Apache/TestMB.pm (original)
+++ perl/Apache-Test/trunk/lib/Apache/TestMB.pm Wed Mar 30 10:48:44 2005
@@ -138,8 +138,7 @@
     unlink $script if -e $script;
 
     # Start the contents of t/TEST.
-    my $body = "BEGIN { eval { require blib && blib->import; } }\n"
-      . Apache::TestConfig->modperl_2_inc_fixup;
+    my $body = "BEGIN { eval { require blib && blib->import; } }\n";
 
     # Configure the arguments for t/TEST.
     while (my($k, $v) = each %{ $self->apache_test_args }) {

Modified: perl/Apache-Test/trunk/lib/Apache/TestMM.pm
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/trunk/lib/Apache/TestMM.pm?view=diff&r1=159504&r2=159505
==============================================================================
--- perl/Apache-Test/trunk/lib/Apache/TestMM.pm (original)
+++ perl/Apache-Test/trunk/lib/Apache/TestMM.pm Wed Mar 30 10:48:44 2005
@@ -116,8 +116,6 @@
 
     my $body = "BEGIN { eval { require blib && blib->import; } }\n";
 
-    $body .= Apache::TestConfig->modperl_2_inc_fixup;
-
     my %args = @Apache::TestMM::Argv;
     while (my($k, $v) = each %args) {
         $v =~ s/\|/\\|/g;

Modified: perl/Apache-Test/trunk/lib/Apache/TestReport.pm
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/trunk/lib/Apache/TestReport.pm?view=diff&r1=159504&r2=159505
==============================================================================
--- perl/Apache-Test/trunk/lib/Apache/TestReport.pm (original)
+++ perl/Apache-Test/trunk/lib/Apache/TestReport.pm Wed Mar 30 10:48:44 2005
@@ -37,7 +37,6 @@
 
     my $content = join "\n",
         "BEGIN { eval { require blib && blib->import; } }",
-        Apache::TestConfig->modperl_2_inc_fixup,
         Apache::TestConfig->perlscript_header,
         "use $class;",
         "$class->new(\@ARGV)->run;";

Modified: perl/Apache-Test/trunk/lib/Apache/TestRun.pm
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/trunk/lib/Apache/TestRun.pm?view=diff&r1=159504&r2=159505
==============================================================================
--- perl/Apache-Test/trunk/lib/Apache/TestRun.pm (original)
+++ perl/Apache-Test/trunk/lib/Apache/TestRun.pm Wed Mar 30 10:48:44 2005
@@ -1263,8 +1263,6 @@
 
     my $body = "BEGIN { eval { require blib && blib->import; } }\n";
 
-    $body .= Apache::TestConfig->modperl_2_inc_fixup;
-
     my %args = @Apache::TestMM::Argv;
     while (my($k, $v) = each %args) {
         $v =~ s/\|/\\|/g;

Modified: perl/Apache-Test/trunk/lib/Apache/TestRunPerl.pm
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/trunk/lib/Apache/TestRunPerl.pm?view=diff&r1=159504&r2=159505
==============================================================================
--- perl/Apache-Test/trunk/lib/Apache/TestRunPerl.pm (original)
+++ perl/Apache-Test/trunk/lib/Apache/TestRunPerl.pm Wed Mar 30 10:48:44 2005
@@ -50,7 +50,7 @@
 
     # sanity checking and loading the right mod_perl version
     if ($rev == 2) {
-        eval { require Apache2 && require mod_perl };
+        eval { require mod_perl2 };
     } else {
         eval { require mod_perl };
     }

Modified: perl/Apache-Test/trunk/lib/Apache/TestSmoke.pm
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/trunk/lib/Apache/TestSmoke.pm?view=diff&r1=159504&r2=159505
==============================================================================
--- perl/Apache-Test/trunk/lib/Apache/TestSmoke.pm (original)
+++ perl/Apache-Test/trunk/lib/Apache/TestSmoke.pm Wed Mar 30 10:48:44 2005
@@ -771,7 +771,6 @@
 
     my $content = join "\n",
         "BEGIN { eval { require blib && blib->import; } }",
-        Apache::TestConfig->modperl_2_inc_fixup,
         Apache::TestConfig->perlscript_header,
         "use $class;",
         "$class->new(\@ARGV)->run;";

Modified: perl/Apache-Test/trunk/t/conf/extra.conf.in
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/trunk/t/conf/extra.conf.in?view=diff&r1=159504&r2=159505
==============================================================================
--- perl/Apache-Test/trunk/t/conf/extra.conf.in (original)
+++ perl/Apache-Test/trunk/t/conf/extra.conf.in Wed Mar 30 10:48:44 2005
@@ -6,9 +6,6 @@
 </IfModule>
 
 <IfModule mod_perl.c>
-  <IfDefine APACHE2>
-    PerlModule Apache2
-  </IfDefine>
 
   <Location /TestMore__testpm>
     SetHandler perl-script