This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Cleanup ext/B tests for -w and to run separately
[perl5.git] / ext / B / t / optree_check.t
index b91da13..af1dbab 100644 (file)
@@ -1,8 +1,13 @@
 #!perl
 
 BEGIN {
-    chdir 't';
-    @INC = ('../lib', '../ext/B/t');
+    if ($ENV{PERL_CORE}){
+       chdir('t') if -d 't';
+       @INC = ('.', '../lib', '../ext/B/t');
+    } else {
+       unshift @INC, 't';
+       push @INC, "../../t";
+    }
     require Config;
     if (($Config::Config{'extensions'} !~ /\bB\b/) ){
         print "1..0 # Skip -- Perl configured without B module\n";
@@ -13,7 +18,7 @@ BEGIN {
            "1..0 # Skip: Data::Dumper was not built, needed by OptreeCheck\n";
        exit 0;
     }
-    require './test.pl';
+    require 'test.pl';
 }
 
 use OptreeCheck;