| 1 |
|
| 2 |
BEGIN { |
| 3 |
use lib qw{ . } ; |
| 4 |
use ExtUtils::testlib ; |
| 5 |
use Cwd ; |
| 6 |
|
| 7 |
$ENV{MOD_PERL} =~ m#/(\d+)\.(\d+)# ; |
| 8 |
$mp2 = 1 if ($1 == 2 || ($1 == 1 && $2 >= 99)) ; |
| 9 |
|
| 10 |
if ($mp2 && $ENV{PERL5LIB}) |
| 11 |
{ |
| 12 |
$ENV{PERL5LIB} =~ /^(.*)$/ ; |
| 13 |
eval 'use lib split (/:/, $1) ;' ; |
| 14 |
} |
| 15 |
my $dir = Cwd::fastcwd ; |
| 16 |
$dir =~ s#/#\\#g ; |
| 17 |
$dir =~ /^(.+)$/ ; |
| 18 |
$dir = $1 ; # untaint |
| 19 |
$ENV{EMBPERL_SRC} =~ /^(.*?)$/; |
| 20 |
my $cwd = $1 ; # untaint |
| 21 |
my $i = 0 ; |
| 22 |
foreach (@INC) |
| 23 |
{ |
| 24 |
$INC[$i] = "$cwd/$_" if (/^\.?\/?blib/) ; |
| 25 |
$INC[$i] = "$cwd/$1" if (/^\Q$dir\E\\(blib\\.+)$/i) ; |
| 26 |
$INC[$i] =~ s#//#/#g ; |
| 27 |
$i++ ; |
| 28 |
} |
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
if (!$mp2) |
| 33 |
{ |
| 34 |
require Apache ; |
| 35 |
require Apache::Registry ; |
| 36 |
} |
| 37 |
else |
| 38 |
{ |
| 39 |
eval 'use Apache2' ; |
| 40 |
# require ModPerl::Registry ; |
| 41 |
} |
| 42 |
|
| 43 |
} ; |
| 44 |
|
| 45 |
|
| 46 |
BEGIN |
| 47 |
{ |
| 48 |
$ENV{EMBPERL_SRC} =~ /^(.*?)$/; |
| 49 |
my $cwd = $1 ; |
| 50 |
|
| 51 |
eval "use lib \"$cwd/eg/forms\"" ; |
| 52 |
|
| 53 |
if ($ENV{TEST_PRELOAD}) |
| 54 |
{ |
| 55 |
$Embperl::initparam{debug} = 0x7fffffff ; |
| 56 |
$Embperl::initparam{preloadfiles} = [ |
| 57 |
{ inputfile => "$cwd/test/html/div.htm", input_escmode => 7, debug => 0x7fffffff }, |
| 58 |
{ inputfile => "$cwd/test/html/EmbperlObject/sub/eposubs.htm", input_escmode => 7, debug => 0x7fffffff } |
| 59 |
] ; |
| 60 |
print "Preload initated\n" ; |
| 61 |
} |
| 62 |
|
| 63 |
} |
| 64 |
|
| 65 |
# Bug#418067: apache2.2-mpm (at least) doesn't create a new process |
| 66 |
# group with apache -X. When exiting though, it SIGTERM's whatever |
| 67 |
# the process group happens to be, wreaking havoc. More importantly |
| 68 |
# it causes 'make test' to exit with failure. Hack around that here: |
| 69 |
use POSIX (); |
| 70 |
POSIX::setpgid(0,0); |
| 71 |
|
| 72 |
use Embperl ; |
| 73 |
use Embperl::Object ; |
| 74 |
|
| 75 |
$ENV{EMBPERL_SRC} =~ /^(.*?)$/; |
| 76 |
my $cwd = $1 ; |
| 77 |
|
| 78 |
require "$cwd/test/testapp.pl" ; |
| 79 |
|
| 80 |
$cp = Embperl::Util::AddCompartment ('TEST') ; |
| 81 |
|
| 82 |
$cp -> deny (':base_loop') ; |
| 83 |
$testshare = "Shared Data" ; |
| 84 |
$cp -> share ('$testshare') ; |
| 85 |
|
| 86 |
1 ; |