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 th...@apache.org on 2004/10/05 21:45:08 UTC

cvs commit: httpd-test/perl-framework/Apache-Test/lib/Apache TestMB.pm

theory      2004/10/05 12:45:08

  Modified:    perl-framework/Apache-Test/lib/Apache TestMB.pm
  Log:
  Added testcover action.
  
  Revision  Changes    Path
  1.8       +28 -1     httpd-test/perl-framework/Apache-Test/lib/Apache/TestMB.pm
  
  Index: TestMB.pm
  ===================================================================
  RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestMB.pm,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- TestMB.pm	5 Sep 2004 00:11:30 -0000	1.7
  +++ TestMB.pm	5 Oct 2004 19:45:08 -0000	1.8
  @@ -60,6 +60,27 @@
                        '-bugreport', '-verbose=' . ($self->verbose || 0));
   }
   
  +sub ACTION_testcover {
  +    my $self = shift;
  +
  +    unless ($self->find_module_by_name('Devel::Cover', \@INC)) {
  +        warn("Cannot run testcover action unless Devel::Cover "
  +             . "is installed.\n");
  +        return;
  +    }
  +
  +    $self->add_to_cleanup('coverage', 'cover_db');
  +
  +    my $atdir = $self->localize_file_path("$ENV{HOME}/.apache-test");
  +    local $Test::Harness::switches    =
  +    local $Test::Harness::Switches    =
  +    local $ENV{HARNESS_PERL_SWITCHES} = "-MDevel::Cover=+inc,'$atdir'";
  +    local $ENV{APACHE_TEST_EXTRA_ARGS} = "-one-process";
  +
  +    $self->depends_on('test');
  +    $self->do_system('cover');
  +}
  +
   sub _bliblib {
       my $self = shift;
       return (
  @@ -69,7 +90,7 @@
   }
   
   sub ACTION_test {
  -    my $self = shift;
  +    my $self = shift
       $self->depends_on('code');
       $self->depends_on('run_tests');
       $self->depends_on('test_clean');
  @@ -233,6 +254,12 @@
   This action actually the tests by executing the test script,
   F<t/TEST>. It is executed by the C<test> action, so most of the time
   it won't be executed directly.
  +
  +=item testcover
  +
  +C<Apache::TestMB> overrides this action from C<Module::Build> in order to
  +prevent the C<Apache::Test> preference files from being included in the test
  +coverage.
   
   =back
   
  
  
  

Re: cvs commit: httpd-test/perl-framework/Apache-Test/lib/Apache TestMB.pm

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

theory@apache.org wrote:
> theory      2004/10/05 12:45:08
> 
>   Modified:    perl-framework/Apache-Test/lib/Apache TestMB.pm
>   Log:
>   Added testcover action.

entry in Changes?

--Geoff

Re: cvs commit: httpd-test/perl-framework/Apache-Test/lib/Apache TestMB.pm

Posted by "Philippe M. Chiasson" <go...@apache.org>.

theory@apache.org wrote:
> theory      2004/10/05 12:45:08
> 
>   Modified:    perl-framework/Apache-Test/lib/Apache TestMB.pm
>   Log:
>   Added testcover action.
>   
>   Revision  Changes    Path
>   1.8       +28 -1     httpd-test/perl-framework/Apache-Test/lib/Apache/TestMB.pm
>   
>   Index: TestMB.pm
>   ===================================================================
>   RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestMB.pm,v
>   retrieving revision 1.7
>   retrieving revision 1.8
>   diff -u -r1.7 -r1.8
>   --- TestMB.pm	5 Sep 2004 00:11:30 -0000	1.7
>   +++ TestMB.pm	5 Oct 2004 19:45:08 -0000	1.8
>   @@ -60,6 +60,27 @@
>                         '-bugreport', '-verbose=' . ($self->verbose || 0));
>    }
>    
>   +sub ACTION_testcover {
>   +    my $self = shift;
>   +
>   +    unless ($self->find_module_by_name('Devel::Cover', \@INC)) {
>   +        warn("Cannot run testcover action unless Devel::Cover "
>   +             . "is installed.\n");
>   +        return;
>   +    }
>   +
>   +    $self->add_to_cleanup('coverage', 'cover_db');
>   +
>   +    my $atdir = $self->localize_file_path("$ENV{HOME}/.apache-test");
>   +    local $Test::Harness::switches    =
>   +    local $Test::Harness::Switches    =
>   +    local $ENV{HARNESS_PERL_SWITCHES} = "-MDevel::Cover=+inc,'$atdir'";
>   +    local $ENV{APACHE_TEST_EXTRA_ARGS} = "-one-process";
>   +
>   +    $self->depends_on('test');
>   +    $self->do_system('cover');
>   +}
>   +
>    sub _bliblib {
>        my $self = shift;
>        return (
>   @@ -69,7 +90,7 @@
>    }
>    
>    sub ACTION_test {
>   -    my $self = shift;
>   +    my $self = shift

Feels like a typo to me ^^^

>        $self->depends_on('code');
>        $self->depends_on('run_tests');
>        $self->depends_on('test_clean');
>   @@ -233,6 +254,12 @@
>    This action actually the tests by executing the test script,
>    F<t/TEST>. It is executed by the C<test> action, so most of the time
>    it won't be executed directly.
>   +
>   +=item testcover
>   +
>   +C<Apache::TestMB> overrides this action from C<Module::Build> in order to
>   +prevent the C<Apache::Test> preference files from being included in the test
>   +coverage.
>    
>    =back
>    
>   
>   
>   
> 

-- 
--------------------------------------------------------------------------------
Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5
http://gozer.ectoplasm.org/     F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5