gozer       2004/08/10 17:13:50

  Modified:    t/response/TestAPI module.pm
  Added:       t/response/TestAPI command.pm
  Log:
  Move Apache::Command tests out of the Apache::Directive tests and into
  their own test module
  
  Revision  Changes    Path
  1.15      +0 -14     modperl-2.0/t/response/TestAPI/module.pm
  
  Index: module.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/response/TestAPI/module.pm,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- module.pm 23 Jul 2004 23:55:26 -0000      1.14
  +++ module.pm 11 Aug 2004 00:13:50 -0000      1.15
  @@ -25,7 +25,6 @@
       my $top_module_name = (defined $top_module && $top_module->name()) || '';
   
       my $tests = 11;
  -    $tests += 3 if $top_module_name eq 'mod_perl.c';
   
       plan $r, tests => $tests;
   
  @@ -40,19 +39,6 @@
                scalar(keys %{ $cfg->{modules} }),
                q{$top_module->module_index})
           || 1; # the A-T config could be wrong
  -
  -    #XXX: some of these tests will fail if modperl is linked static
  -    #rather than dso.
  -
  -    if ($top_module_name eq 'mod_perl.c') {
  -        ok t_cmp($top_module_name, 'mod_perl.c', q{$top_module->name}) || 1;
  -
  -        my $cmd = $top_module->cmds;
  -
  -        ok defined $cmd;
  -
  -        ok UNIVERSAL::isa($cmd, 'Apache::Command');
  -    }
   
       if (0) { #XXX: currently fails with --enable-mods-shared=all
           local $cfg->{modules}->{'mod_perl.c'} = 1;
  
  
  
  1.1                  modperl-2.0/t/response/TestAPI/command.pm
  
  Index: command.pm
  ===================================================================
  
  package TestAPI::command;
  
  use strict;
  use warnings FATAL => 'all';
  
  use Apache::Test;
  use Apache::TestConfig;
  use Apache::TestUtil;
  use Apache::BuildConfig;
  use Apache::Command;
  
  use Apache::Module ();
  use DynaLoader ();
  
  use Apache::Const -compile => qw(OK ITERATE OR_ALL);
  
  sub handler {
      my $r = shift;
      
      plan $r, tests => 6;
      
      my $mod_perl_module = Apache::Module::find_linked_module('mod_perl.c');
      
      ok $mod_perl_module;
      
      my $cmd = $mod_perl_module->cmds;
      
      ok defined $cmd;
  
      ok UNIVERSAL::isa($cmd, 'Apache::Command');
      
      while ($cmd) {
          if ($cmd->name eq 'PerlHandler') {
              ok t_cmp($cmd->args_how, Apache::ITERATE, 'args_how');
              ok t_cmp($cmd->errmsg, qr/Subroutine name/, 'errmsg');
              ok t_cmp($cmd->req_override, Apache::OR_ALL, 'req_override');
              last;
          }
          $cmd = $cmd->next;
      }
      
      Apache::OK;
  }
  
  1;
  
  
  

Reply via email to