You are viewing a plain text version of this content. The canonical link for it is here.
Posted to test-cvs@httpd.apache.org by st...@apache.org on 2003/04/23 04:24:17 UTC

cvs commit: httpd-test/perl-framework/Apache-Test/lib/Apache TestConfig.pm TestConfigParse.pm TestConfigPerl.pm TestRun.pm TestRunPerl.pm

stas        2003/04/22 19:24:17

  Modified:    perl-framework/Apache-Test/lib/Apache TestConfig.pm
                        TestConfigParse.pm TestConfigPerl.pm TestRun.pm
                        TestRunPerl.pm
  Log:
  more fixes for httpd.conf pickup of modperl.so/libperl.so for mod_perl 1.x
  
  Revision  Changes    Path
  1.154     +13 -3     httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfig.pm
  
  Index: TestConfig.pm
  ===================================================================
  RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfig.pm,v
  retrieving revision 1.153
  retrieving revision 1.154
  diff -u -r1.153 -r1.154
  --- TestConfig.pm	22 Apr 2003 08:09:47 -0000	1.153
  +++ TestConfig.pm	23 Apr 2003 02:24:16 -0000	1.154
  @@ -11,8 +11,10 @@
   
   use constant DEFAULT_PORT => 8529;
   
  -use constant IS_MOD_PERL_2_BUILD =>
  -    eval { require mod_perl } && $mod_perl::VERSION >= 1.99 &&
  +use constant IS_MOD_PERL_2       =>
  +    eval { require mod_perl } && $mod_perl::VERSION >= 1.99;
  +
  +use constant IS_MOD_PERL_2_BUILD => IS_MOD_PERL_2 &&
       eval { require Apache::Build } && Apache::Build::IS_MOD_PERL_BUILD();
   
   use Symbol ();
  @@ -117,7 +119,7 @@
   sub server { shift->{server} }
   
   sub modperl_2_inc_fixup {
  -    IS_MOD_PERL_2_BUILD ? '' : "use Apache2;\n";
  +    (IS_MOD_PERL_2 && !IS_MOD_PERL_2_BUILD) ? "use Apache2;\n" : '';
   }
   
   sub modperl_build_config {
  @@ -640,6 +642,14 @@
               return $file;
           }
       }
  +
  +    # if the module wasn't found try to lookup in the list of modules
  +    # inherited from the system-wide httpd.conf
  +    my $name = $module;
  +    $name =~ s/\.s[ol]$/.c/;  #mod_info.so => mod_info.c
  +    $name =~ s/^lib/mod_/; #libphp4.so => mod_php4.c
  +    return $self->{modules}->{$name} if $self->{modules}->{$name};
  +
   }
   
   #generate files and directories
  
  
  
  1.32      +8 -6      httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfigParse.pm
  
  Index: TestConfigParse.pm
  ===================================================================
  RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfigParse.pm,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- TestConfigParse.pm	14 Apr 2003 06:34:08 -0000	1.31
  +++ TestConfigParse.pm	23 Apr 2003 02:24:16 -0000	1.32
  @@ -87,20 +87,20 @@
   #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 %skip_modules = map { $_, 1 } qw(mod_jk.c mod_casp2.c);
  +my %autoconfig_skip_module = map { $_, 1 } 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 config_parse_skip_module_add {
  +sub autoconfig_skip_module_add {
       my($name) = @_;
  -    $skip_modules{$name} = 1;
  +    $autoconfig_skip_module{$name} = 1;
   }
   
   sub should_skip_module {
       my($self, $name) = @_;
  -    return $skip_modules{$name} ? 1 : 0;
  +    return $autoconfig_skip_module{$name} ? 1 : 0;
   }
   
   #inherit LoadModule
  @@ -122,14 +122,16 @@
   
           $name = $modname_alias{$name} if $modname_alias{$name};
   
  +        # remember all found modules
  +        $self->{modules}->{$name} = $file;
  +        debug "Found: $modname => $name";
  +
           if ($self->should_skip_module($name)) {
               debug "Skipping LoadModule of $name";
               next;
           }
   
           debug "LoadModule $modname $name";
  -
  -        $self->{modules}->{$name} = 1;
   
           $self->preamble($directive => qq($modname "$file"));
       }
  
  
  
  1.71      +6 -4      httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfigPerl.pm
  
  Index: TestConfigPerl.pm
  ===================================================================
  RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfigPerl.pm,v
  retrieving revision 1.70
  retrieving revision 1.71
  diff -u -r1.70 -r1.71
  --- TestConfigPerl.pm	18 Apr 2003 08:06:18 -0000	1.70
  +++ TestConfigPerl.pm	23 Apr 2003 02:24:16 -0000	1.71
  @@ -17,9 +17,11 @@
   
       my $server = $self->{server};
       my $libname = $server->version_of(\%libmodperl);
  -
       my $vars = $self->{vars};
  -    if ($server->{rev} >= 2) {
  +
  +    # XXX: $server->{rev} could be set to 2 as a fallback, even when
  +    # the wanted version is 1. So check that we use mod_perl 2
  +    if ($server->{rev} >= 2 && IS_MOD_PERL_2) {
           if (my $build_config = $self->modperl_build_config()) {
               $libname = $build_config->{MODPERL_LIB_SHARED};
               $vars->{libmodperl} ||= $self->find_apache_module($libname);
  @@ -49,7 +51,7 @@
   
       my $cfg = '';
   
  -    if (exists $vars->{libmodperl} && -e $vars->{libmodperl}) {
  +    if ($vars->{libmodperl} && -e $vars->{libmodperl}) {
           if (Apache::TestConfig::WIN32) {
               my $lib = "$Config{installbin}\\$Config{libperl}";
               $lib =~ s/lib$/dll/;
  @@ -58,7 +60,7 @@
           $cfg .= 'LoadModule ' . qq(perl_module "$vars->{libmodperl}"\n);
       }
       else {
  -        my $msg = "unable to locate $libname\n";
  +        my $msg = "unable to locate $libname (could be a static build)\n";
           $cfg = "#$msg";
           debug $msg;
       }
  
  
  
  1.106     +2 -1      httpd-test/perl-framework/Apache-Test/lib/Apache/TestRun.pm
  
  Index: TestRun.pm
  ===================================================================
  RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestRun.pm,v
  retrieving revision 1.105
  retrieving revision 1.106
  diff -u -r1.105 -r1.106
  --- TestRun.pm	27 Mar 2003 22:19:30 -0000	1.105
  +++ TestRun.pm	23 Apr 2003 02:24:16 -0000	1.106
  @@ -438,7 +438,8 @@
           error "no test server configured, please specify an httpd or ".
                 ($test_config->{APXS} ?
                  "an apxs other than $test_config->{APXS}" : "apxs").
  -               " or put either in your PATH";
  +               " or put either in your PATH. For example:\n" .
  +               "$0 -httpd /path/to/bin/httpd";
           exit_perl 0;
       }
   
  
  
  
  1.13      +3 -6      httpd-test/perl-framework/Apache-Test/lib/Apache/TestRunPerl.pm
  
  Index: TestRunPerl.pm
  ===================================================================
  RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestRunPerl.pm,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- TestRunPerl.pm	22 Apr 2003 08:24:41 -0000	1.12
  +++ TestRunPerl.pm	23 Apr 2003 02:24:16 -0000	1.13
  @@ -4,6 +4,7 @@
   use warnings FATAL => 'all';
   
   use Apache::TestRun ();
  +use Apache::TestConfigParse ();
   
   use File::Spec::Functions qw(catfile);
   
  @@ -14,12 +15,8 @@
   sub pre_configure {
       my $self = shift;
   
  -    # don't pick up 'LoadModule ... mod_perl.so' from the global
  -    # httpd.conf, when using the locally built .so in the mod_perl 2.0
  -    # 'make test'
  -    if (Apache::TestConfig::IS_MOD_PERL_2_BUILD()) {
  -        Apache::TestConfig::config_parse_skip_module_add('mod_perl.c');
  -    }
  +    # Apache::TestConfigPerl already configures mod_perl.so
  +    Apache::TestConfig::autoconfig_skip_module_add('mod_perl.c');
   }
   
   sub configure_modperl {