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 / f_map.t
index 449d730..851428d 100644 (file)
@@ -1,8 +1,13 @@
 #!perl
 
 BEGIN {
-    chdir q(t);
-    @INC = qw(../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";
@@ -21,7 +26,7 @@ BEGIN {
         print "1..0 # Skip -- TODO - provide golden result regexps for 5.8\n";
         exit 0;
     }
-   require q(./test.pl);
+    require q(test.pl);
 }
 use OptreeCheck;
 plan tests => 9;