diff options
author | David Mitchell <davem@iabyn.com> | 2017-04-07 09:32:01 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2017-04-07 14:42:23 +0100 |
commit | 5051ccfe60d1e4a46b98d4ac72fb2b70f7c54444 (patch) | |
tree | e2ebe2b47b6a587972950659a1c070285d758246 | |
parent | 19641fd71ab87a4234f86f69f958b61278dbdade (diff) | |
download | perl-5051ccfe60d1e4a46b98d4ac72fb2b70f7c54444.tar.gz |
fixup tests under t/ that assumed '.' in @INC
-rwxr-xr-x | Porting/bench.pl | 6 | ||||
-rw-r--r-- | Porting/manisort | 2 | ||||
-rw-r--r-- | t/porting/bench.t | 9 | ||||
-rw-r--r-- | t/porting/copyright.t | 6 | ||||
-rw-r--r-- | t/thread_it.pl | 2 | ||||
-rw-r--r-- | t/uni/lower.t | 2 | ||||
-rw-r--r-- | t/uni/title.t | 2 | ||||
-rw-r--r-- | t/uni/upper.t | 2 |
8 files changed, 12 insertions, 19 deletions
diff --git a/Porting/bench.pl b/Porting/bench.pl index 62c6aaff54..b073a0198b 100755 --- a/Porting/bench.pl +++ b/Porting/bench.pl @@ -1421,8 +1421,10 @@ EOF }, ); - for ('t', '.') { - last if require "$_/test.pl"; + for ('./t', '.') { + my $t = "$_/test.pl"; + next unless -f $t; + require $t; } plan(@tests / 3 * keys %VALID_FIELDS); diff --git a/Porting/manisort b/Porting/manisort index 3d698e2743..167aada734 100644 --- a/Porting/manisort +++ b/Porting/manisort @@ -14,7 +14,7 @@ $| = 1; # Get command line options use Getopt::Long; -require "Porting/manifest_lib.pl"; +require "./Porting/manifest_lib.pl"; my $outfile; my $check_only = 0; my $quiet = 0; diff --git a/t/porting/bench.t b/t/porting/bench.t index bbebd377b8..d15474c1c8 100644 --- a/t/porting/bench.t +++ b/t/porting/bench.t @@ -2,14 +2,9 @@ # run Porting/bench.pl's selftest -BEGIN { - @INC = '..' if -f '../TestInit.pm'; -} -use TestInit qw(T A); # T is chdir to the top level, A makes paths absolute use strict; +chdir '..' if -f 'test.pl' && -f 'thread_it.pl'; require './t/test.pl'; -my $source = find_git_or_skip('all'); -chdir $source or die "Can't chdir to $source: $!"; -system "$^X Porting/bench.pl --action=selftest"; +system "$^X -I. -MTestInit Porting/bench.pl --action=selftest"; diff --git a/t/porting/copyright.t b/t/porting/copyright.t index daa95f806e..8a469cda89 100644 --- a/t/porting/copyright.t +++ b/t/porting/copyright.t @@ -18,13 +18,9 @@ working on older releases. It should be run before making a new release. =cut -BEGIN { - unshift @INC, '.' if -f 'TestInit.pm'; -} -use TestInit; use strict; use Config; -BEGIN { require 'test.pl' } +BEGIN { require './test.pl' } if ( $Config{usecrosscompile} ) { skip_all( "Not all files are available during cross-compilation" ); diff --git a/t/thread_it.pl b/t/thread_it.pl index 4a0cbdcd8a..6389df2907 100644 --- a/t/thread_it.pl +++ b/t/thread_it.pl @@ -19,7 +19,7 @@ my $caller = (caller)[1]; die "Can't figure out which test to run from filename '$caller'" unless $caller =~ m!((?:op|re)/[-_a-z0-9A-Z]+)_thr\.t\z!; -my $file = "$1.t"; +my $file = "./$1.t"; $::running_as_thread = "running tests in a new thread"; require $file; diff --git a/t/uni/lower.t b/t/uni/lower.t index 31fd1f7159..a215f60bc7 100644 --- a/t/uni/lower.t +++ b/t/uni/lower.t @@ -4,7 +4,7 @@ BEGIN { print("1..0 # miniperl: no Unicode::Normalize"); exit(0); } - require "uni/case.pl"; + require "./uni/case.pl"; } use feature 'unicode_strings'; diff --git a/t/uni/title.t b/t/uni/title.t index 458ca8efd1..45c895f709 100644 --- a/t/uni/title.t +++ b/t/uni/title.t @@ -4,7 +4,7 @@ BEGIN { print("1..0 # miniperl: no Unicode::Normalize"); exit(0); } - require "uni/case.pl"; + require "./uni/case.pl"; } use feature 'unicode_strings'; diff --git a/t/uni/upper.t b/t/uni/upper.t index 532f4bdd7b..252b51ce39 100644 --- a/t/uni/upper.t +++ b/t/uni/upper.t @@ -4,7 +4,7 @@ BEGIN { print("1..0 # miniperl: no Unicode::Normalize"); exit(0); } - require "uni/case.pl"; + require "./uni/case.pl"; } use feature 'unicode_strings'; |