stas 2003/03/26 23:57:06
Modified: perl-framework/Apache-Test/lib/Apache TestConfig.pm
TestMM.pm TestReport.pm TestRun.pm TestSmoke.pm
Log:
add a function that will return the string 'use Apache2;\n" for inclusion
in autogenerated scripts if Apache::Test sees $mod_perl::VERSION >= 1.99
Revision Changes Path
1.148 +6 -0
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.147
retrieving revision 1.148
diff -u -r1.147 -r1.148
--- TestConfig.pm 26 Mar 2003 06:11:55 -0000 1.147
+++ TestConfig.pm 27 Mar 2003 07:57:06 -0000 1.148
@@ -112,6 +112,12 @@
sub server { shift->{server} }
+sub modperl_2_inc_fixup {
+ (eval { require mod_perl } && $mod_perl::VERSION >= 1.99)
+ ? "use Apache2;\n"
+ : '';
+}
+
sub modperl_build_config {
eval {
require Apache::Build;
1.24 +1 -1
httpd-test/perl-framework/Apache-Test/lib/Apache/TestMM.pm
Index: TestMM.pm
===================================================================
RCS file:
/home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestMM.pm,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- TestMM.pm 26 Mar 2003 07:35:33 -0000 1.23
+++ TestMM.pm 27 Mar 2003 07:57:06 -0000 1.24
@@ -72,7 +72,7 @@
unlink $file if -e $file;
- my $body = '';
+ my $body = Apache::TestConfig->modperl_2_inc_fixup;
if (@Apache::TestMM::Argv) {
$body .= "\%Apache::TestConfig::Argv = qw(@Apache::TestMM::Argv);\n";
1.7 +4 -3
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.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- TestReport.pm 15 May 2002 03:12:54 -0000 1.6
+++ TestReport.pm 27 Mar 2003 07:57:06 -0000 1.7
@@ -20,10 +20,11 @@
$file ||= catfile 't', 'REPORT';
- my $header = Apache::TestConfig->perlscript_header;
-
my $content = join "\n",
- $header, "use $class;", "$class->new([EMAIL PROTECTED])->run;";
+ Apache::TestConfig->modperl_2_inc_fixup,
+ Apache::TestConfig->perlscript_header,
+ "use $class;",
+ "$class->new([EMAIL PROTECTED])->run;";
Apache::Test::config()->write_perlscript($file, $content);
}
1.104 +1 -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.103
retrieving revision 1.104
diff -u -r1.103 -r1.104
--- TestRun.pm 26 Mar 2003 07:35:33 -0000 1.103
+++ TestRun.pm 27 Mar 2003 07:57:06 -0000 1.104
@@ -833,7 +833,7 @@
$file ||= catfile 't', 'TEST';
- my $body = '';
+ my $body = Apache::TestConfig->modperl_2_inc_fixup;
if (@Apache::TestMM::Argv) {
$body .= "\%Apache::TestConfig::Argv = qw(@Apache::TestMM::Argv);\n";
1.18 +4 -3
httpd-test/perl-framework/Apache-Test/lib/Apache/TestSmoke.pm
Index: TestSmoke.pm
===================================================================
RCS file:
/home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestSmoke.pm,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- TestSmoke.pm 1 Feb 2003 07:13:22 -0000 1.17
+++ TestSmoke.pm 27 Mar 2003 07:57:06 -0000 1.18
@@ -460,10 +460,11 @@
$file ||= catfile 't', 'SMOKE';
- my $header = Apache::TestConfig->perlscript_header;
-
my $content = join "\n",
- $header, "use $class ();", "$class->new([EMAIL PROTECTED])->run;";
+ Apache::TestConfig->modperl_2_inc_fixup,
+ Apache::TestConfig->perlscript_header,
+ "use $class;",
+ "$class->new([EMAIL PROTECTED])->run;";
Apache::Test::config()->write_perlscript($file, $content);
}