Re: Pluggable lint patch
[p5sagit/p5-mst-13.2.git] / ext / B / t / o.t
index 55a5364..2b84f39 100644 (file)
@@ -1,8 +1,18 @@
 #!./perl -w
 
 BEGIN {
-       chdir 't' if -d 't';
-       @INC = ('../lib', 'lib', '.');
+        if ($ENV{PERL_CORE}){
+               chdir('t') if -d 't';
+               @INC = ('.', 'lib', '../lib');
+        } 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";
+               exit 0;
+       }
        require 'test.pl';
 }
 
@@ -60,6 +70,7 @@ sub get_lines {
 
 END {
        1 while unlink($file);
+       rmdir($path); # not "1 while" since there might be more in there
 }
 
 __END__