# this is ugly and dirty but we do not yet have a Test::Embedded or
# similar
+# set up -I
+require Config;
+$ENV{PERL5LIB} = join ($Config::Config{path_sep}, @INC);
+($ENV{PATH}) = $ENV{PATH} =~ /(.+)/;
+
+
my $persistence_tests = {
PPerl => {
cmd => [qw/pperl --prefork=1/, __FILE__],
skip 'Main test failed - skipping persistent env tests', 1
unless $TB->is_passing;
- # set up -I
- require Config;
- local $ENV{PERL5LIB} = join ($Config::Config{path_sep}, @INC);
-
local $ENV{DBICTEST_IN_PERSISTENT_ENV} = 1;
require IPC::Open2;
use DBIx::Class::Carp;
my @modules = grep {
- my $mod = $_;
+ my ($mod) = $_ =~ /(.+)/;
# not all modules are loadable at all times
do {
pass ("Your lang is set to $oldlang - retesting with C");
- my @cmd = ($^X, __FILE__);
+ local $ENV{PATH};
+ my @cmd = map { $_ =~ /(.+)/ } ($^X, __FILE__);
# this is cheating, and may even hang here and there (testing on windows passed fine)
# will be replaced with Test::SubExec::Noninteractive in due course
}
# add a "harmless" comment before one of the statements.
-system( qq($^X -pi.bak -e "s/ALTER/-- this is a comment\nALTER/" $fn->{trans_v23}) );
+{
+ my ($perl) = $^X =~ /(.+)/;
+ local $ENV{PATH};
+ system( qq($perl -pi.bak -e "s/ALTER/-- this is a comment\nALTER/" $fn->{trans_v23}) );
+}
# Then attempt v1 -> v3 upgrade
{
use Test::More;
use Config;
use lib qw(t/lib);
-$ENV{PERL5LIB} = join ($Config{path_sep}, @INC);
use DBICTest;
-
BEGIN {
require DBIx::Class;
plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for('admin_script')
unless DBIx::Class::Optional::Dependencies->req_ok_for('admin_script');
}
+$ENV{PATH} = '';
+$ENV{PERL5LIB} = join ($Config{path_sep}, @INC);
+
my @json_backends = qw/XS JSON DWIW/;
# test the script is setting @INC properly
SKIP: {
skip ("MSWin32 doesn't support -| either", 1) if $^O eq 'MSWin32';
- open(my $fh, "-|", ( $^X, 'script/dbicadmin', default_args(), qw|--op=select --attrs={"order_by":"name"}| ) ) or die $!;
+ my ($perl) = $^X =~ /(.*)/;
+
+ open(my $fh, "-|", ( $perl, 'script/dbicadmin', default_args(), qw|--op=select --attrs={"order_by":"name"}| ) ) or die $!;
my $data = do { local $/; <$fh> };
close($fh);
if (!ok( ($data=~/Aran.*Trout/s), "$ENV{JSON_ANY_ORDER}: select with attrs" )) {
# calls it. Bleh.
#
sub test_exec {
- my $perl = $^X;
+ my ($perl) = $^X =~ /(.*)/;
my @args = ('script/dbicadmin', @_);
# see if anyone was holding a lock before us, and wait up to 5 seconds for them to terminate
# if we do not do this we may end up trampling over some long-running END or somesuch
seek ($lock_fh, 0, SEEK_SET) or die "seek failed $!";
- if (read ($lock_fh, my $old_pid, 100) ) {
+ my $old_pid;
+ if (
+ read ($lock_fh, $old_pid, 100)
+ and
+ ($old_pid) = $old_pid =~ /^(\d+)$/
+ ) {
for (1..50) {
kill (0, $old_pid) or last;
sleep 0.1;