matts 2003/07/16 07:30:26
Modified: . Makefile.PL
Log:
Work around stupid bug in Apache::Test
Change Apache::Test to a pre-req, and don't run Apache::Test tests if its
not there.
Revision Changes Path
1.19 +36 -25 xml-axkit/Makefile.PL
Index: Makefile.PL
===================================================================
RCS file: /home/cvs/xml-axkit/Makefile.PL,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- Makefile.PL 25 May 2003 19:33:56 -0000 1.18
+++ Makefile.PL 16 Jul 2003 14:30:13 -0000 1.19
@@ -39,25 +39,6 @@
require lib; lib->import('./install');
require './install/ExtUtils/AutoInstall.pm';
}
-eval { require Apache::TestMM; import Apache::TestMM qw(test clean); };
-if ($@ || $Apache::Test::VERSION < 1.01) {
- warn( "\n",
-
"==================================================================\n",
- "\n",
- "AxKit's test suite requires Apache::Test. AxKit comes\n",
- "with an older version, but it will not be installed. You should\n",
- "install the most recent Apache::Test at your convenience.\n",
- "\n",
-
"==================================================================\n",
- "\n",
- );
- require lib; lib->import('./t/lib');
- require 'Apache::TestMM.pm';
- import Apache::TestMM qw(test clean);
-}
-
-Apache::TestMM::filter_args();
-Apache::TestMM::generate_script('t/TEST');
######################################################
# Standard bits required for have_library and friends
@@ -84,6 +65,10 @@
'File::Basename' => '',
'File::Spec' => '',
],
+ "Apache::Test for live server tests" => [
+ -tests => [ <t/xslt-basic/*.t> ],
+ 'Apache::Test' => '1.00',
+ ],
"Optional modules for using XPathScript" => [
-default => 0,
'XML::Parser' => '2.27',
@@ -110,6 +95,14 @@
require Apache::src;
require Apache::MyConfig;
+require Apache::TestMM;
+import Apache::TestMM qw(test clean);
+
+Apache::TestMM::filter_args();
+Apache::TestMM::generate_script('t/TEST');
+
+fixup_test_script();
+
my $xml_parser_found = eval "require XML::Parser";
eval {
@@ -177,14 +170,14 @@
}
require Apache::MyConfig;
- $config{INC} .= qq{ -I"$Apache::MyConfig::Setup{MODPERL_INC}/../.." }
- . qq{ -I"$Apache::MyConfig::Setup{APACHE_INC}" }
- . qq{ -I"$Apache::MyConfig::Setup{APACHE_INC}/../os/win32" };
+ $config{INC} .= qq( -I"$Apache::MyConfig::Setup{MODPERL_INC}/../.." )
+ . qq( -I"$Apache::MyConfig::Setup{APACHE_INC}" )
+ . qq( -I"$Apache::MyConfig::Setup{APACHE_INC}/../os/win32" );
$config{CCFLAGS} = $Config{ccflags} .
' -D_WINSOCK2API_ -D_MSWSOCK_ -D_INC_SIGNAL -D_INC_MALLOC ';
$config{LIBS} =
- qq{ -L"$Apache::MyConfig::Setup{APACHE_LIB}" -lApacheCore } .
- qq{ -L"$Apache::MyConfig::Setup{MODPERL_LIB}" -lmod_perl};
+ qq( -L"$Apache::MyConfig::Setup{APACHE_LIB}" -lApacheCore ) .
+ qq( -L"$Apache::MyConfig::Setup{MODPERL_LIB}" -lmod_perl);
}
if (!$xml_parser_found) {
@@ -277,6 +270,24 @@
else {
$RUNNING_UNDER_CPAN = $ENV{RUNNING_UNDER_CPAN} || 0;
}
+}
+
+sub fixup_test_script {
+ rename("t/conf/httpd.conf", "t/conf/httpd.conf.bak") || die
"rename(t/conf/httpd.conf => t/conf/httpd.conf.bak) : $!";
+ open(CONF, "<t/conf/httpd.conf.bak") || die "open(t/conf/httpd.conf.bak)
: $!";
+ open(NEWCONF, ">t/conf/httpd.conf") || die "open(t/conf/httpd.conf) :
$!";
+ my $extra_line = '';
+ while (<CONF>) {
+ if (/extra\.conf/) {
+ $extra_line = $_;
+ next;
+ }
+ print NEWCONF $_;
+ }
+ print NEWCONF $extra_line;
+ close(NEWCONF);
+ close(CONF);
+ unlink("t/conf/httpd.conf.bak") || die "unlink(t/conf/httpd.conf.bak) :
$!";
}
sub strip_lfs {