perl-test-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ge...@apache.org
Subject svn commit: r330055 - in /perl/Apache-Test/trunk: Changes lib/Apache/TestConfigPerl.pm lib/Apache/TestRunPerl.pm
Date Tue, 01 Nov 2005 13:48:38 GMT
Author: geoff
Date: Tue Nov  1 05:48:36 2005
New Revision: 330055

URL: http://svn.apache.org/viewcvs?rev=330055&view=rev
Log:
Devel::Cover magic is now fully integrated.  no more modperl_extra.pl
or extra.conf.in fiddling - 'make testcover' should be all you need
to do now 

Modified:
    perl/Apache-Test/trunk/Changes
    perl/Apache-Test/trunk/lib/Apache/TestConfigPerl.pm
    perl/Apache-Test/trunk/lib/Apache/TestRunPerl.pm

Modified: perl/Apache-Test/trunk/Changes
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/trunk/Changes?rev=330055&r1=330054&r2=330055&view=diff
==============================================================================
--- perl/Apache-Test/trunk/Changes (original)
+++ perl/Apache-Test/trunk/Changes Tue Nov  1 05:48:36 2005
@@ -8,6 +8,10 @@
 
 =item 1.28-dev
 
+Devel::Cover magic is now fully integrated.  no more modperl_extra.pl
+or extra.conf.in fiddling - 'make testcover' should be all you need
+to do now [Geoffrey Young]
+
 Implemented a magic @NextAvailablePort@ to be used in config files to
 automatically allocate the next available port [Stas]
 

Modified: perl/Apache-Test/trunk/lib/Apache/TestConfigPerl.pm
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/trunk/lib/Apache/TestConfigPerl.pm?rev=330055&r1=330054&r2=330055&view=diff
==============================================================================
--- perl/Apache-Test/trunk/lib/Apache/TestConfigPerl.pm (original)
+++ perl/Apache-Test/trunk/lib/Apache/TestConfigPerl.pm Tue Nov  1 05:48:36 2005
@@ -145,17 +145,35 @@
     close $fh or die "close $t: $!";
 }
 
-# propogate trace overrides to the server
-sub configure_trace {
+# propogate PerlPassEnv settings to the server
+sub configure_env {
     my $self = shift;
-    $self->postamble(IfModule => 'mod_perl.c',
-                     "PerlPassEnv APACHE_TEST_TRACE_LEVEL\n");
+    $self->preamble(IfModule => 'mod_perl.c', 
+                        [ qw(PerlPassEnv APACHE_TEST_TRACE_LEVEL
+                             PerlPassEnv HARNESS_PERL_SWITCHES)
+                        ]);
 }
 
 sub startup_pl_code {
     my $self = shift;
     my $serverroot = $self->{vars}->{serverroot};
 
+    my $cover = <<'EOF';
+    if ($ENV{HARNESS_PERL_SWITCHES} =~ m/Devel::Cover/) {
+        eval {
+            # 0.48 is the first version of Devel::Cover that can
+            # really generate mod_perl coverage statistics
+            require Devel::Cover;
+            Devel::Cover->VERSION(0.48);
+
+            # this ignores coverage data for some generated files
+            Devel::Cover->import('+inc' => 't/response/',);
+
+            1;
+        } or die "Devel::Cover error: $@";
+    }
+EOF
+
     return <<"EOF";
 BEGIN {
     use lib '$serverroot';
@@ -163,6 +181,8 @@
         eval { require "conf/\$file" } or
             die if grep { -e "\$_/conf/\$file" } \@INC;
     }
+
+$cover
 }
 
 1;

Modified: perl/Apache-Test/trunk/lib/Apache/TestRunPerl.pm
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/trunk/lib/Apache/TestRunPerl.pm?rev=330055&r1=330054&r2=330055&view=diff
==============================================================================
--- perl/Apache-Test/trunk/lib/Apache/TestRunPerl.pm (original)
+++ perl/Apache-Test/trunk/lib/Apache/TestRunPerl.pm Tue Nov  1 05:48:36 2005
@@ -73,10 +73,10 @@
         Apache::TestRun::exit_perl(0);
     }
 
-    $test_config->preamble_register(qw(configure_libmodperl));
+    $test_config->preamble_register(qw(configure_libmodperl
+                                       configure_env));
 
     $test_config->postamble_register(qw(configure_inc
-                                        configure_trace
                                         configure_pm_tests_inc
                                         configure_startup_pl
                                         configure_pm_tests));



Mime
View raw message