Remove last remaining accesses to ->VERSION in lib
[dbsrgits/DBIx-Class.git] / t / 52leaks.t
index b427175..c6b64c2 100644 (file)
@@ -519,12 +519,6 @@ assert_empty_weakregistry ($weak_registry);
 # 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;
 SKIP: {
   skip 'Test already in a persistent loop', 1
@@ -555,7 +549,17 @@ SKIP: {
     @{$persistence_tests->{PPerl}{cmd}}[ 1 .. $#{$persistence_tests->{PPerl}{cmd}} ],
   ];
 
-  require IPC::Open2;
+  # set up -I
+  require Config;
+  $ENV{PERL5LIB} = join ($Config::Config{path_sep}, @INC);
+
+  # adjust PATH for -T
+  if (length $ENV{PATH}) {
+    ( $ENV{PATH} ) = join ( $Config::Config{path_sep},
+      map { length($_) ? File::Spec->rel2abs($_) : () }
+        split /\Q$Config::Config{path_sep}/, $ENV{PATH}
+    ) =~ /\A(.+)\z/;
+  }
 
   for my $type (keys %$persistence_tests) { SKIP: {
     unless (eval "require $type") {
@@ -577,6 +581,8 @@ SKIP: {
         if system(@cmd);
     }
 
+    require IPC::Open2;
+
     for (1,2,3) {
       note ("Starting run in persistent env ($type pass $_)");
       IPC::Open2::open2(my $out, undef, @cmd);