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 do...@apache.org on 2002/05/15 01:01:14 UTC

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

dougm       02/05/14 16:01:14

  Modified:    perl-framework/Apache-Test/lib/Apache TestReport.pm
                        TestReportPerl.pm
  Log:
  tweak Apache::TestReport::generate_script so Apache::TestReportPerl (and
  other subclasses) can inherit it, rather than duplicating everywhere.
  
  Revision  Changes    Path
  1.3       +7 -2      httpd-test/perl-framework/Apache-Test/lib/Apache/TestReport.pm
  
  Index: TestReport.pm
  ===================================================================
  RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestReport.pm,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TestReport.pm	9 Apr 2002 04:07:42 -0000	1.2
  +++ TestReport.pm	14 May 2002 23:01:14 -0000	1.3
  @@ -4,6 +4,7 @@
   use warnings FATAL => 'all';
   
   use Apache::Test ();
  +use Apache::TestConfig ();
   
   use File::Spec::Functions qw(catfile);
   
  @@ -16,21 +17,25 @@
   
       local $/;
       my $content = <DATA>;
  +    $content =~ s/__CLASS__/$class/g;
       Apache::Test::config()->write_perlscript($file, $content);
   
   }
   
  +sub build_config_as_string { Apache::TestConfig::as_string() }
  +
   1;
   __DATA__
   
   use strict;
   use FindBin qw($Bin);
   use lib "$Bin/../Apache-Test/lib";
  +use lib 'lib';
   
  -use Apache::TestConfig ();
  +use __CLASS__ ();
   
   my %map = (
  -    CONFIG     => Apache::TestConfig::as_string(),
  +    CONFIG     => __CLASS__->build_config_as_string,
       EXECUTABLE => $0,
       DATE       => scalar gmtime() . " GMT",
   );
  
  
  
  1.3       +4 -55     httpd-test/perl-framework/Apache-Test/lib/Apache/TestReportPerl.pm
  
  Index: TestReportPerl.pm
  ===================================================================
  RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestReportPerl.pm,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TestReportPerl.pm	9 Apr 2002 04:07:42 -0000	1.2
  +++ TestReportPerl.pm	14 May 2002 23:01:14 -0000	1.3
  @@ -3,67 +3,16 @@
   use strict;
   use warnings FATAL => 'all';
   
  -use Apache::Test ();
   use Apache::TestReport ();
  -
  -use File::Spec::Functions qw(catfile);
  +use ModPerl::Config ();
   
   # a subclass of Apache::TestReport that generates a bug report script
   use vars qw(@ISA);
   @ISA = qw(Apache::TestReport);
   
  -# generate t/REPORT script (or a different filename) which will drive
  -# Apache::TestReportPerl
  -sub generate_script {
  -    my ($class, $file) = @_;
  -
  -    $file ||= catfile 't', 'REPORT';
  -
  -    local $/;
  -    my $content = <DATA>;
  -    Apache::Test::config()->write_perlscript($file, $content);
  -
  +sub build_config_as_string {
  +    ModPerl::Config::as_string();
   }
   
   1;
  -__DATA__
  -use strict;
  -use FindBin qw($Bin);
  -use lib "$Bin/../lib";
  -
  -use ModPerl::Config ();
  -
  -my %map = (
  -    CONFIG     => ModPerl::Config::as_string(),
  -    EXECUTABLE => $0,
  -    DATE       => scalar gmtime() . " GMT",
  -);
  -{
  -    local $/ = undef;
  -    my $template = <DATA>;
  -    $template =~ s/\@(\w+)\@/$map{$1}||''/eg;
  -    print $template;
  -}
  -
  -__DATA__
  -
  --------------8<---------- Start Bug Report ------------8<----------
  -1. Problem Description:
  -
  -  [DESCRIBE THE PROBLEM HERE]
  -
  -2. Used Components and their Configuration:
  -
  -@CONFIG@
  -
  -3. This is the core dump trace: (if you get a core dump):
  -
  -  [CORE TRACE COMES HERE]
  -
  -This report was generated by @EXECUTABLE@ on @DATE@.
  -
  --------------8<---------- End Bug Report --------------8<----------
  -
  -Note: Complete the rest of the details and post this bug report to dev
  -<at> perl.apache.org. To subscribe to the list send an empty email to
  -dev-subscribe@perl.apache.org.
  +__END__
  
  
  

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

Posted by Stas Bekman <st...@stason.org>.
dougm@apache.org wrote:
> dougm       02/05/14 16:01:14
> 
>   Modified:    perl-framework/Apache-Test/lib/Apache TestReport.pm
>                         TestReportPerl.pm
>   Log:
>   tweak Apache::TestReport::generate_script so Apache::TestReportPerl (and
>   other subclasses) can inherit it, rather than duplicating everywhere.

you cannot re-use the httpd __DATA__ section as is, as this part is 
unique to modperl:

 >   -Note: Complete the rest of the details and post this bug report to dev
 >   -<at> perl.apache.org. To subscribe to the list send an empty email to
 >   -dev-subscribe@perl.apache.org.

probably should make the contact data configurable and set it via %map. 
It seems that the contact info should be set in Makefile.PL.

>   Revision  Changes    Path
>   1.3       +7 -2      httpd-test/perl-framework/Apache-Test/lib/Apache/TestReport.pm
>   
>   Index: TestReport.pm
>   ===================================================================
>   RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestReport.pm,v
>   retrieving revision 1.2
>   retrieving revision 1.3
>   diff -u -r1.2 -r1.3
>   --- TestReport.pm	9 Apr 2002 04:07:42 -0000	1.2
>   +++ TestReport.pm	14 May 2002 23:01:14 -0000	1.3
>   @@ -4,6 +4,7 @@
>    use warnings FATAL => 'all';
>    
>    use Apache::Test ();
>   +use Apache::TestConfig ();
>    
>    use File::Spec::Functions qw(catfile);
>    
>   @@ -16,21 +17,25 @@
>    
>        local $/;
>        my $content = <DATA>;
>   +    $content =~ s/__CLASS__/$class/g;
>        Apache::Test::config()->write_perlscript($file, $content);
>    
>    }
>    
>   +sub build_config_as_string { Apache::TestConfig::as_string() }
>   +
>    1;
>    __DATA__
>    
>    use strict;
>    use FindBin qw($Bin);
>    use lib "$Bin/../Apache-Test/lib";
>   +use lib 'lib';
>    
>   -use Apache::TestConfig ();
>   +use __CLASS__ ();
>    
>    my %map = (
>   -    CONFIG     => Apache::TestConfig::as_string(),
>   +    CONFIG     => __CLASS__->build_config_as_string,
>        EXECUTABLE => $0,
>        DATE       => scalar gmtime() . " GMT",
>    );
>   
>   
>   
>   1.3       +4 -55     httpd-test/perl-framework/Apache-Test/lib/Apache/TestReportPerl.pm
>   
>   Index: TestReportPerl.pm
>   ===================================================================
>   RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestReportPerl.pm,v
>   retrieving revision 1.2
>   retrieving revision 1.3
>   diff -u -r1.2 -r1.3
>   --- TestReportPerl.pm	9 Apr 2002 04:07:42 -0000	1.2
>   +++ TestReportPerl.pm	14 May 2002 23:01:14 -0000	1.3
>   @@ -3,67 +3,16 @@
>    use strict;
>    use warnings FATAL => 'all';
>    
>   -use Apache::Test ();
>    use Apache::TestReport ();
>   -
>   -use File::Spec::Functions qw(catfile);
>   +use ModPerl::Config ();
>    
>    # a subclass of Apache::TestReport that generates a bug report script
>    use vars qw(@ISA);
>    @ISA = qw(Apache::TestReport);
>    
>   -# generate t/REPORT script (or a different filename) which will drive
>   -# Apache::TestReportPerl
>   -sub generate_script {
>   -    my ($class, $file) = @_;
>   -
>   -    $file ||= catfile 't', 'REPORT';
>   -
>   -    local $/;
>   -    my $content = <DATA>;
>   -    Apache::Test::config()->write_perlscript($file, $content);
>   -
>   +sub build_config_as_string {
>   +    ModPerl::Config::as_string();
>    }
>    
>    1;
>   -__DATA__
>   -use strict;
>   -use FindBin qw($Bin);
>   -use lib "$Bin/../lib";
>   -
>   -use ModPerl::Config ();
>   -
>   -my %map = (
>   -    CONFIG     => ModPerl::Config::as_string(),
>   -    EXECUTABLE => $0,
>   -    DATE       => scalar gmtime() . " GMT",
>   -);
>   -{
>   -    local $/ = undef;
>   -    my $template = <DATA>;
>   -    $template =~ s/\@(\w+)\@/$map{$1}||''/eg;
>   -    print $template;
>   -}
>   -
>   -__DATA__
>   -
>   --------------8<---------- Start Bug Report ------------8<----------
>   -1. Problem Description:
>   -
>   -  [DESCRIBE THE PROBLEM HERE]
>   -
>   -2. Used Components and their Configuration:
>   -
>   -@CONFIG@
>   -
>   -3. This is the core dump trace: (if you get a core dump):
>   -
>   -  [CORE TRACE COMES HERE]
>   -
>   -This report was generated by @EXECUTABLE@ on @DATE@.
>   -
>   --------------8<---------- End Bug Report --------------8<----------
>   -
>   -Note: Complete the rest of the details and post this bug report to dev
>   -<at> perl.apache.org. To subscribe to the list send an empty email to
>   -dev-subscribe@perl.apache.org.
>   +__END__
>   
>   
>   



-- 


__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com