This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Ensure that we don't pick up any "system perl" libraries in @INC.
authorJames E Keenan <jkeenan@cpan.org>
Thu, 1 Feb 2018 02:59:21 +0000 (21:59 -0500)
committerJames E Keenan <jkeenan@cpan.org>
Fri, 23 Feb 2018 15:26:42 +0000 (10:26 -0500)
We need a tightly defined @INC which, for this test file, only needs './lib'
so that we can locate the two pragmata and Config.

For: RT # 132795

t/porting/bench.t

index ee4c1c3..7c137c1 100644 (file)
@@ -7,9 +7,9 @@
 # See also t/porting/bench_selftest.pl
 
 BEGIN {
-    chdir '..' if -f 'test.pl' && -f 'thread_it.pl';
+    chdir '..' if -f 'test.pl';
+    @INC = ( './lib' );
     require './t/test.pl';
-    push @INC, 'lib';
 }
 
 use warnings;
@@ -22,7 +22,7 @@ use Config;
 # Only test on a platform likely to support forking, pipes, cachegrind
 # etc.  Add other platforms if you think they're safe.
 
-skip_all "not devel"   unless -d ".git";
+skip_all "not devel"   unless -d "./.git";
 skip_all "not linux"   unless $^O eq 'linux';
 skip_all "no valgrind" unless -x '/bin/valgrind' || -x '/usr/bin/valgrind';
 # Address sanitizer clashes horribly with cachegrind