Fix testcases to run properly outside perl core build enviroment.
p4raw-id: //depot/perl@17980
use 5.003_11;
use strict;
-our $VERSION = "2.08";
+$Safe::VERSION = "2.09";
use Carp;
# the whole glob *_ rather than $_ and @_ separately, otherwise
# @_ in non default packages within the compartment don't work.
$obj->share_from('main', $default_share);
- Opcode::_safe_pkg_prep($obj->{Root});
+ Opcode::_safe_pkg_prep($obj->{Root}) if($Opcode::VERSION > 1.04);
return $obj;
}
#!./perl -w
$|=1;
BEGIN {
- chdir 't' if -d 't';
- @INC = '../lib';
+ if($ENV{PERL_CORE}) {
+ chdir 't' if -d 't';
+ @INC = '../lib';
+ }
require Config; import Config;
if ($Config{'extensions'} !~ /\bOpcode\b/ && $Config{'osname'} ne 'VMS') {
print "1..0\n";
exit 0;
}
+
}
# Tests Todo:
#!./perl -w
$|=1;
BEGIN {
- chdir 't' if -d 't';
- @INC = '../lib';
+ if($ENV{PERL_CORE}) {
+ chdir 't' if -d 't';
+ @INC = '../lib';
+ }
require Config; import Config;
if ($Config{'extensions'} !~ /\bOpcode\b/ && $Config{'osname'} ne 'VMS') {
print "1..0\n";
$cpt = new Safe "Root";
$cpt->reval(q{ system("echo not ok 1"); });
-if ($@ =~ /^'system' trapped by operation mask/) {
+if ($@ =~ /^'?system'? trapped by operation mask/) {
print "ok 1\n";
} else {
print "#$@" if $@;
if ($ENV{PERL_CORE}) {
chdir 't' if -d 't';
@INC = '../lib';
- require Config; import Config;
- if ($Config{'extensions'} !~ /\bOpcode\b/
- && $Config{'extensions'} !~ /\bPOSIX\b/
- && $Config{'osname'} ne 'VMS')
- {
- print "1..0\n";
- exit 0;
- }
+ }
+ require Config; import Config;
+ if ($Config{'extensions'} !~ /\bOpcode\b/
+ && $Config{'extensions'} !~ /\bPOSIX\b/
+ && $Config{'osname'} ne 'VMS')
+ {
+ print "1..0\n";
+ exit 0;
}
}