#
# Start by running a script via mod_perl, then switch to running a
# script via mod_speedycgi and you get an "Internal server error".
#
# The GATEWAY_INTERFACE is set to "CGI-Perl" by mod_perl, so in
# speedycgy when "use CGI" is compiled it thinks it's running under
# mod_perl, and tries to use the Apache module which failes.
#
use lib 't';
use ModTest;
my $libperl = `apxs -q LIBEXECDIR` . '/libperl.so';
my $docroot = ModTest::docroot;
my $scr = 'speedy/mod_perl';
ModTest::test_init(
5,
[$scr],
"
LoadModule perl_module $libperl
AddModule mod_perl.c
DefaultType perl-script
PerlHandler Apache::Registry
"
);
sub getit { my $which = shift;
return ModTest::html_get("/$which/mod_perl") =~ /$which/i;
}
if (getit('mod_perl')) {
print "1..1\n";
sleep 1;
if (getit('speedy')) {
print "ok\n";
} else {
print "failed\n";
}
} else {
# Mod_perl failed, skip this test
print "1..0\n";
}