From 3d7c117d5246fe5390f3fda7bd31308799d54201 Mon Sep 17 00:00:00 2001 From: "H.Merijn Brand" Date: Sat, 22 Oct 2016 13:55:48 +0200 Subject: [PATCH] Patch unit tests to explicitly insert "." into @INC when needed. require calls now require ./ to be prepended to the file since . is no longer guaranteed to be in @INC. --- Makefile.SH | 2 +- Porting/checkcfgvar.pl | 2 +- Porting/makemeta | 2 +- Porting/new-perldelta.pl | 2 +- Porting/pod_rules.pl | 4 ++-- TestInit.pm | 2 +- autodoc.pl | 4 ++-- cpan/Devel-PPPort/devel/mktodo | 2 +- cpan/Devel-PPPort/devel/mktodo.pl | 2 +- cpan/Devel-PPPort/devel/regenerate | 2 +- cpan/Devel-PPPort/devel/scanprov | 2 +- cpan/Devel-PPPort/parts/apicheck.pl | 2 +- cpan/Math-BigInt/t/bare_mbf.t | 2 +- cpan/Math-BigInt/t/bare_mbi.t | 2 +- cpan/Math-BigInt/t/bare_mif.t | 2 +- cpan/Math-BigInt/t/bigfltpm.t | 2 +- cpan/Math-BigInt/t/bigintpm.t | 2 +- cpan/Math-BigInt/t/mbf_ali.t | 2 +- cpan/Math-BigInt/t/mbi_ali.t | 2 +- cpan/Math-BigInt/t/mbimbf.t | 2 +- cpan/Math-BigInt/t/sub_ali.t | 2 +- cpan/Math-BigInt/t/sub_mbf.t | 2 +- cpan/Math-BigInt/t/sub_mbi.t | 2 +- cpan/Math-BigInt/t/sub_mif.t | 2 +- cpan/Math-BigInt/t/upgrade.t | 2 +- cpan/Math-BigInt/t/upgradef.t | 2 +- cpan/Math-BigInt/t/with_sub.t | 2 +- cpan/Math-BigRat/t/bigfltrt.t | 2 +- cpan/Math-BigRat/t/bigratpm.t | 2 +- cpan/perlfaq/lib/perlfaq5.pod | 4 ++-- cpan/perlfaq/lib/perlfaq8.pod | 2 +- dist/Thread-Queue/t/01_basic.t | 2 +- dist/Thread-Queue/t/02_refs.t | 2 +- dist/Thread-Queue/t/03_peek.t | 2 +- dist/Thread-Queue/t/05_extract.t | 2 +- dist/Thread-Queue/t/06_insert.t | 2 +- dist/Thread-Queue/t/07_lock.t | 2 +- dist/Thread-Queue/t/10_timed.t | 2 +- dist/Thread-Semaphore/t/01_basic.t | 2 +- dist/Thread-Semaphore/t/04_nonblocking.t | 2 +- dist/Thread-Semaphore/t/05_force.t | 2 +- ext/DynaLoader/t/DynaLoader.t | 2 +- h2pl/cbreak.pl | 2 +- h2pl/cbreak2.pl | 2 +- lib/h2ph.t | 1 - lib/strict.t | 2 +- lib/warnings.t | 2 +- makedef.pl | 2 +- pod/buildtoc | 2 +- pod/perlmodlib.PL | 2 +- regen.pl | 2 +- regen/ebcdic.pl | 7 +++++-- regen/embed.pl | 4 ++-- regen/feature.pl | 2 +- regen/genpacksizetables.pl | 2 +- regen/keywords.pl | 2 +- regen/lib_cleanup.pl | 4 ++-- regen/mg_vtable.pl | 2 +- regen/miniperlmain.pl | 2 +- regen/mk_PL_charclass.pl | 4 ++-- regen/mk_invlists.pl | 4 ++-- regen/opcode.pl | 4 ++-- regen/overload.pl | 2 +- regen/reentr.pl | 2 +- regen/regcharclass.pl | 4 ++-- regen/regcomp.pl | 2 +- regen/uconfig_h.pl | 2 +- regen/unicode_constants.pl | 4 ++-- regen/warnings.pl | 2 +- regen_perly.pl | 2 +- t/comp/line_debug.t | 2 ++ t/lib/warnings/op | 1 + t/op/goto.t | 2 +- t/porting/authors.t | 2 +- t/porting/bench.t | 2 +- t/porting/cmp_version.t | 2 +- t/porting/corelist.t | 2 +- t/porting/diag.t | 4 ++-- t/porting/globvar.t | 2 +- t/porting/manifest.t | 2 +- t/porting/pending-author.t | 2 +- t/porting/pod_rules.t | 2 +- t/porting/readme.t | 2 +- t/porting/regen.t | 6 +++--- t/porting/utils.t | 2 +- t/re/pat.t | 6 +++--- t/run/runenv.t | 3 ++- t/run/switches.t | 6 +++--- t/test.pl | 3 ++- utils/Makefile.PL | 2 +- utils/c2ph.PL | 4 ++-- utils/perlivp.PL | 2 +- 92 files changed, 116 insertions(+), 109 deletions(-) diff --git a/Makefile.SH b/Makefile.SH index b1c4765..491d1a6 100755 --- a/Makefile.SH +++ b/Makefile.SH @@ -345,7 +345,7 @@ RUN_PERL = \$(LDLIBPTH) \$(RUN) $perl\$(EXE_EXT) $spitshell >>$Makefile <{delta_version}}; diff --git a/Porting/pod_rules.pl b/Porting/pod_rules.pl index 37cbb9c..7bf1380 100644 --- a/Porting/pod_rules.pl +++ b/Porting/pod_rules.pl @@ -32,8 +32,8 @@ if (ord("A") == 193) { # plan9 => 'plan9/mkfile', ); -require 'Porting/pod_lib.pl'; -require 'Porting/manifest_lib.pl'; +require './Porting/pod_lib.pl'; +require './Porting/manifest_lib.pl'; sub my_die; # process command-line switches diff --git a/TestInit.pm b/TestInit.pm index f4ed6fd..f9a5e91 100644 --- a/TestInit.pm +++ b/TestInit.pm @@ -47,7 +47,7 @@ sub import { } elsif ($_ eq 'T') { $chdir = '..' unless -f 't/TEST' && -f 'MANIFEST' && -d 'lib' && -d 'ext'; - @INC = 'lib'; + @INC = qw/ lib . /; $setopt = 1; } else { die "Unknown option '$_'"; diff --git a/autodoc.pl b/autodoc.pl index ce4846e..597607c 100644 --- a/autodoc.pl +++ b/autodoc.pl @@ -29,8 +29,8 @@ if (@ARGV) { chdir $workdir or die "Couldn't chdir to '$workdir': $!"; } -require 'regen/regen_lib.pl'; -require 'regen/embed_lib.pl'; +require './regen/regen_lib.pl'; +require './regen/embed_lib.pl'; # # See database of global and static function prototypes in embed.fnc diff --git a/cpan/Devel-PPPort/devel/mktodo b/cpan/Devel-PPPort/devel/mktodo index c5c2a9b..2eb9ea3 100644 --- a/cpan/Devel-PPPort/devel/mktodo +++ b/cpan/Devel-PPPort/devel/mktodo @@ -17,7 +17,7 @@ use strict; use Getopt::Long; -require 'devel/devtools.pl'; +require './devel/devtools.pl'; our %opt = ( base => 0, diff --git a/cpan/Devel-PPPort/devel/mktodo.pl b/cpan/Devel-PPPort/devel/mktodo.pl index 9345a23..c479eab 100644 --- a/cpan/Devel-PPPort/devel/mktodo.pl +++ b/cpan/Devel-PPPort/devel/mktodo.pl @@ -22,7 +22,7 @@ use IO::Select; use Config; use Time::HiRes qw( gettimeofday tv_interval ); -require 'devel/devtools.pl'; +require './devel/devtools.pl'; our %opt = ( debug => 0, diff --git a/cpan/Devel-PPPort/devel/regenerate b/cpan/Devel-PPPort/devel/regenerate index dad5338..bc1742d 100644 --- a/cpan/Devel-PPPort/devel/regenerate +++ b/cpan/Devel-PPPort/devel/regenerate @@ -20,7 +20,7 @@ use File::Copy; use Getopt::Long; use Pod::Usage; -require 'devel/devtools.pl'; +require './devel/devtools.pl'; our %opt = ( check => 1, diff --git a/cpan/Devel-PPPort/devel/scanprov b/cpan/Devel-PPPort/devel/scanprov index 86910e4..804524c 100644 --- a/cpan/Devel-PPPort/devel/scanprov +++ b/cpan/Devel-PPPort/devel/scanprov @@ -17,7 +17,7 @@ use strict; use Getopt::Long; -require 'parts/ppptools.pl'; +require './parts/ppptools.pl'; our %opt = ( mode => 'check', diff --git a/cpan/Devel-PPPort/parts/apicheck.pl b/cpan/Devel-PPPort/parts/apicheck.pl index ac119a6..69d8502 100644 --- a/cpan/Devel-PPPort/parts/apicheck.pl +++ b/cpan/Devel-PPPort/parts/apicheck.pl @@ -15,7 +15,7 @@ ################################################################################ use strict; -require 'parts/ppptools.pl'; +require './parts/ppptools.pl'; if (@ARGV) { my $file = pop @ARGV; diff --git a/cpan/Math-BigInt/t/bare_mbf.t b/cpan/Math-BigInt/t/bare_mbf.t index 6b9af66..2167dca 100644 --- a/cpan/Math-BigInt/t/bare_mbf.t +++ b/cpan/Math-BigInt/t/bare_mbf.t @@ -13,4 +13,4 @@ our ($CLASS, $CALC); $CLASS = "Math::BigFloat"; $CALC = "Math::BigInt::BareCalc"; # backend -require 't/bigfltpm.inc'; # all tests here for sharing +require './t/bigfltpm.inc'; # all tests here for sharing diff --git a/cpan/Math-BigInt/t/bare_mbi.t b/cpan/Math-BigInt/t/bare_mbi.t index 93dbc7a..f2b768d 100644 --- a/cpan/Math-BigInt/t/bare_mbi.t +++ b/cpan/Math-BigInt/t/bare_mbi.t @@ -15,4 +15,4 @@ our ($CLASS, $CALC); $CLASS = "Math::BigInt"; $CALC = "Math::BigInt::BareCalc"; # backend -require 't/bigintpm.inc'; # perform same tests as bigintpm.t +require './t/bigintpm.inc'; # perform same tests as bigintpm.t diff --git a/cpan/Math-BigInt/t/bare_mif.t b/cpan/Math-BigInt/t/bare_mif.t index d63e3da..e7b9774 100644 --- a/cpan/Math-BigInt/t/bare_mif.t +++ b/cpan/Math-BigInt/t/bare_mif.t @@ -21,4 +21,4 @@ $mbf = 'Math::BigFloat'; is(Math::BigInt->config()->{lib}, 'Math::BigInt::BareCalc', 'Math::BigInt->config()->{lib}'); -require 't/mbimbf.inc'; +require './t/mbimbf.inc'; diff --git a/cpan/Math-BigInt/t/bigfltpm.t b/cpan/Math-BigInt/t/bigfltpm.t index 629cb56..a256b9f 100644 --- a/cpan/Math-BigInt/t/bigfltpm.t +++ b/cpan/Math-BigInt/t/bigfltpm.t @@ -33,4 +33,4 @@ SKIP: { is(ref($e->{_e}->[0]), '', '$e->{_e}->[0] is a scalar'); } -require 't/bigfltpm.inc'; # all tests here for sharing +require './t/bigfltpm.inc'; # all tests here for sharing diff --git a/cpan/Math-BigInt/t/bigintpm.t b/cpan/Math-BigInt/t/bigintpm.t index e87e05a..cd552ca 100644 --- a/cpan/Math-BigInt/t/bigintpm.t +++ b/cpan/Math-BigInt/t/bigintpm.t @@ -44,4 +44,4 @@ is($x, "9903520314281112085086151826", ############################################################################# # all the other tests -require 't/bigintpm.inc'; # all tests here for sharing +require './t/bigintpm.inc'; # all tests here for sharing diff --git a/cpan/Math-BigInt/t/mbf_ali.t b/cpan/Math-BigInt/t/mbf_ali.t index b44b64c..3999aa7 100644 --- a/cpan/Math-BigInt/t/mbf_ali.t +++ b/cpan/Math-BigInt/t/mbf_ali.t @@ -12,4 +12,4 @@ use Math::BigFloat; our $CLASS; $CLASS = 'Math::BigFloat'; -require 't/alias.inc'; +require './t/alias.inc'; diff --git a/cpan/Math-BigInt/t/mbi_ali.t b/cpan/Math-BigInt/t/mbi_ali.t index e65aa3c..45ed6c4 100644 --- a/cpan/Math-BigInt/t/mbi_ali.t +++ b/cpan/Math-BigInt/t/mbi_ali.t @@ -12,4 +12,4 @@ use Math::BigInt; our $CLASS; $CLASS = 'Math::BigInt'; -require 't/alias.inc'; +require './t/alias.inc'; diff --git a/cpan/Math-BigInt/t/mbimbf.t b/cpan/Math-BigInt/t/mbimbf.t index dd65da4..107da31 100644 --- a/cpan/Math-BigInt/t/mbimbf.t +++ b/cpan/Math-BigInt/t/mbimbf.t @@ -15,7 +15,7 @@ use Math::BigFloat; our $mbi = 'Math::BigInt'; our $mbf = 'Math::BigFloat'; -require 't/mbimbf.inc'; +require './t/mbimbf.inc'; # some tests that won't work with subclasses, since the things are only # guaranteed in the Math::Big(Int|Float) (unless subclass chooses to support diff --git a/cpan/Math-BigInt/t/sub_ali.t b/cpan/Math-BigInt/t/sub_ali.t index 6023be3..2f145b4 100644 --- a/cpan/Math-BigInt/t/sub_ali.t +++ b/cpan/Math-BigInt/t/sub_ali.t @@ -14,4 +14,4 @@ use Math::BigInt::Subclass; our $CLASS; $CLASS = 'Math::BigInt::Subclass'; -require 't/alias.inc'; +require './t/alias.inc'; diff --git a/cpan/Math-BigInt/t/sub_mbf.t b/cpan/Math-BigInt/t/sub_mbf.t index 69311d4..e438581 100644 --- a/cpan/Math-BigInt/t/sub_mbf.t +++ b/cpan/Math-BigInt/t/sub_mbf.t @@ -14,7 +14,7 @@ our ($CLASS, $CALC); $CLASS = "Math::BigFloat::Subclass"; $CALC = Math::BigFloat->config()->{lib}; # backend -require 't/bigfltpm.inc'; # perform same tests as bigfltpm +require './t/bigfltpm.inc'; # perform same tests as bigfltpm ############################################################################### # Now do custom tests for Subclass itself diff --git a/cpan/Math-BigInt/t/sub_mbi.t b/cpan/Math-BigInt/t/sub_mbi.t index e991ad9..500f2a4 100644 --- a/cpan/Math-BigInt/t/sub_mbi.t +++ b/cpan/Math-BigInt/t/sub_mbi.t @@ -14,7 +14,7 @@ our ($CLASS, $CALC); $CLASS = "Math::BigInt::Subclass"; $CALC = "Math::BigInt::Calc"; # backend -require 't/bigintpm.inc'; # perform same tests as bigintpm +require './t/bigintpm.inc'; # perform same tests as bigintpm ############################################################################### # Now do custom tests for Subclass itself diff --git a/cpan/Math-BigInt/t/sub_mif.t b/cpan/Math-BigInt/t/sub_mif.t index 96bf82f..250db3f 100644 --- a/cpan/Math-BigInt/t/sub_mif.t +++ b/cpan/Math-BigInt/t/sub_mif.t @@ -17,4 +17,4 @@ our ($mbi, $mbf); $mbi = 'Math::BigInt::Subclass'; $mbf = 'Math::BigFloat::Subclass'; -require 't/mbimbf.inc'; +require './t/mbimbf.inc'; diff --git a/cpan/Math-BigInt/t/upgrade.t b/cpan/Math-BigInt/t/upgrade.t index 2307a48..7ed4378 100644 --- a/cpan/Math-BigInt/t/upgrade.t +++ b/cpan/Math-BigInt/t/upgrade.t @@ -19,4 +19,4 @@ is(Math::BigInt->upgrade(), "Math::BigFloat", is(Math::BigInt->downgrade() || "", "", qq/Math::BigInt->downgrade() || ""/); -require 't/upgrade.inc'; # all tests here for sharing +require './t/upgrade.inc'; # all tests here for sharing diff --git a/cpan/Math-BigInt/t/upgradef.t b/cpan/Math-BigInt/t/upgradef.t index d208890..dbe373f 100644 --- a/cpan/Math-BigInt/t/upgradef.t +++ b/cpan/Math-BigInt/t/upgradef.t @@ -67,4 +67,4 @@ is($z, 321, . q| $z = $x->badd($y); $z|); # not yet: -#require 't/upgrade.inc'; # all tests here for sharing +#require './t/upgrade.inc'; # all tests here for sharing diff --git a/cpan/Math-BigInt/t/with_sub.t b/cpan/Math-BigInt/t/with_sub.t index 2c54107..299eea5 100644 --- a/cpan/Math-BigInt/t/with_sub.t +++ b/cpan/Math-BigInt/t/with_sub.t @@ -19,4 +19,4 @@ $CALC = "Math::BigInt::Calc"; # backend is(Math::BigFloat->config()->{with}, 'Math::BigInt::Calc', 'Math::BigFloat->config()->{with}'); -require 't/bigfltpm.inc'; # all tests here for sharing +require './t/bigfltpm.inc'; # all tests here for sharing diff --git a/cpan/Math-BigRat/t/bigfltrt.t b/cpan/Math-BigRat/t/bigfltrt.t index 4f36bde..97f8032 100644 --- a/cpan/Math-BigRat/t/bigfltrt.t +++ b/cpan/Math-BigRat/t/bigfltrt.t @@ -16,4 +16,4 @@ $CALC = "Math::BigInt::Calc"; pass(); # fails still too many tests -#require 't/bigfltpm.inc'; # all tests here for sharing +#require './t/bigfltpm.inc'; # all tests here for sharing diff --git a/cpan/Math-BigRat/t/bigratpm.t b/cpan/Math-BigRat/t/bigratpm.t index a5bb947..675d1e9 100644 --- a/cpan/Math-BigRat/t/bigratpm.t +++ b/cpan/Math-BigRat/t/bigratpm.t @@ -11,4 +11,4 @@ our ($CLASS, $CALC); $CLASS = "Math::BigRat"; $CALC = "Math::BigInt::Calc"; # backend -require 't/bigratpm.inc'; # all tests here for sharing +require './t/bigratpm.inc'; # all tests here for sharing diff --git a/cpan/perlfaq/lib/perlfaq5.pod b/cpan/perlfaq/lib/perlfaq5.pod index 22e88b8..239f92a 100644 --- a/cpan/perlfaq/lib/perlfaq5.pod +++ b/cpan/perlfaq/lib/perlfaq5.pod @@ -1278,7 +1278,7 @@ comes with Perl tries to convert C include files to Perl code, which can be Cd. FIONREAD ends up defined as a function in the I file: - require 'sys/ioctl.ph'; + require './sys/ioctl.ph'; $size = pack("L", 0); ioctl(FH, FIONREAD(), $size) or die "Couldn't call ioctl: $!\n"; @@ -1378,7 +1378,7 @@ used for things that Perl opened itself, even if it was a dup of a numeric descriptor as with C above. But if you really have to, you may be able to do this: - require 'sys/syscall.ph'; + require './sys/syscall.ph'; my $rc = syscall(SYS_close(), $fd + 0); # must force numeric die "can't sysclose $fd: $!" unless $rc == -1; diff --git a/cpan/perlfaq/lib/perlfaq8.pod b/cpan/perlfaq/lib/perlfaq8.pod index 3431417..42b27ab 100644 --- a/cpan/perlfaq/lib/perlfaq8.pod +++ b/cpan/perlfaq/lib/perlfaq8.pod @@ -239,7 +239,7 @@ and in pixels: This is more portable than the raw C, but not as illustrative: - require 'sys/ioctl.ph'; + require './sys/ioctl.ph'; die "no TIOCGWINSZ " unless defined &TIOCGWINSZ; open(my $tty_fh, "+ $ARGS{PLATFORM}; -require "$ARGS{TARG_DIR}regen/embed_lib.pl"; +require "./$ARGS{TARG_DIR}regen/embed_lib.pl"; # Is the following guard strictly necessary? Added during refactoring # to keep the same behaviour when merging other code into here. diff --git a/pod/buildtoc b/pod/buildtoc index acb8cf6..75bdcf2 100644 --- a/pod/buildtoc +++ b/pod/buildtoc @@ -14,7 +14,7 @@ no locale; BEGIN { my $Top = File::Spec->catdir($FindBin::Bin, File::Spec->updir); chdir $Top or die "Can't chdir to $Top: $!"; - require 'Porting/pod_lib.pl'; + require './Porting/pod_lib.pl'; } die "$0: Usage: $0 [--quiet]\n" diff --git a/pod/perlmodlib.PL b/pod/perlmodlib.PL index 615ae4c..b92f9ca 100644 --- a/pod/perlmodlib.PL +++ b/pod/perlmodlib.PL @@ -13,7 +13,7 @@ if (@ARGV) { chdir $workdir or die "Couldn't chdir to '$workdir': $!"; } -require 'regen/regen_lib.pl'; +require './regen/regen_lib.pl'; # MANIFEST itself is Unix style filenames, so we have to assume that Unix style # filenames will work. diff --git a/regen.pl b/regen.pl index 8788668..71a6eda 100644 --- a/regen.pl +++ b/regen.pl @@ -15,7 +15,7 @@ use strict; my $tap = $ARGV[0] && $ARGV[0] eq '--tap' ? '# ' : ''; foreach my $pl (map {chomp; "regen/$_"} ) { - my @command = ($^X, $pl, @ARGV); + my @command = ($^X, '-I.', $pl, @ARGV); print "$tap@command\n"; system @command and die "@command failed: $?" diff --git a/regen/ebcdic.pl b/regen/ebcdic.pl index fa8a051..a3e049d 100644 --- a/regen/ebcdic.pl +++ b/regen/ebcdic.pl @@ -1,8 +1,11 @@ use v5.16.0; use strict; use warnings; -require 'regen/regen_lib.pl'; -require 'regen/charset_translations.pl'; + +BEGIN { unshift @INC, '.' } + +require './regen/regen_lib.pl'; +require './regen/charset_translations.pl'; # Generates the EBCDIC translation tables that were formerly hard-coded into # utfebcdic.h diff --git a/regen/embed.pl b/regen/embed.pl index 50ca2eb..19256eb 100755 --- a/regen/embed.pl +++ b/regen/embed.pl @@ -26,8 +26,8 @@ use strict; BEGIN { # Get function prototypes - require 'regen/regen_lib.pl'; - require 'regen/embed_lib.pl'; + require './regen/regen_lib.pl'; + require './regen/embed_lib.pl'; } my $SPLINT = 0; # Turn true for experimental splint support http://www.splint.org diff --git a/regen/feature.pl b/regen/feature.pl index 97d0359..f8cf4a8 100755 --- a/regen/feature.pl +++ b/regen/feature.pl @@ -11,7 +11,7 @@ # This script is normally invoked from regen.pl. BEGIN { - require 'regen/regen_lib.pl'; + require './regen/regen_lib.pl'; push @INC, './lib'; } use strict ; diff --git a/regen/genpacksizetables.pl b/regen/genpacksizetables.pl index 7a03dcd..d886822 100644 --- a/regen/genpacksizetables.pl +++ b/regen/genpacksizetables.pl @@ -3,7 +3,7 @@ # it will generate EBCDIC too. (TODO) use strict; use Encode; -require 'regen/regen_lib.pl'; +require './regen/regen_lib.pl'; sub make_text { my ($chrmap, $letter, $unpredictable, $nocsum, $size, $condition) = @_; diff --git a/regen/keywords.pl b/regen/keywords.pl index eafe58c..9619d86 100755 --- a/regen/keywords.pl +++ b/regen/keywords.pl @@ -11,7 +11,7 @@ use strict; use Devel::Tokenizer::C 0.05; -require 'regen/regen_lib.pl'; +require './regen/regen_lib.pl'; my $h = open_new('keywords.h', '>', { by => 'regen/keywords.pl', from => 'its data', diff --git a/regen/lib_cleanup.pl b/regen/lib_cleanup.pl index c9d6e43..5e40b40 100644 --- a/regen/lib_cleanup.pl +++ b/regen/lib_cleanup.pl @@ -1,7 +1,7 @@ #!perl -w use strict; -require 'regen/regen_lib.pl'; -require 'Porting/pod_lib.pl'; +require './regen/regen_lib.pl'; +require './Porting/pod_lib.pl'; use vars qw($TAP $Verbose); # For processing later diff --git a/regen/mg_vtable.pl b/regen/mg_vtable.pl index a05a7d4..342f5e0 100644 --- a/regen/mg_vtable.pl +++ b/regen/mg_vtable.pl @@ -20,7 +20,7 @@ require 5.004; BEGIN { # Get function prototypes - require 'regen/regen_lib.pl'; + require './regen/regen_lib.pl'; } my %mg = diff --git a/regen/miniperlmain.pl b/regen/miniperlmain.pl index 9123b3f..37a3fff 100644 --- a/regen/miniperlmain.pl +++ b/regen/miniperlmain.pl @@ -4,7 +4,7 @@ use strict; BEGIN { # Get function prototypes - require 'regen/regen_lib.pl'; + require './regen/regen_lib.pl'; unshift @INC, 'ext/ExtUtils-Miniperl/lib'; } diff --git a/regen/mk_PL_charclass.pl b/regen/mk_PL_charclass.pl index 5b609e5..8b217b3 100644 --- a/regen/mk_PL_charclass.pl +++ b/regen/mk_PL_charclass.pl @@ -2,8 +2,8 @@ use v5.15.8; use strict; use warnings; -require 'regen/regen_lib.pl'; -require 'regen/charset_translations.pl'; +require './regen/regen_lib.pl'; +require './regen/charset_translations.pl'; # This program outputs l1_charclass_tab.h, which defines the guts of the # PL_charclass table. Each line is a bit map of properties that the Unicode diff --git a/regen/mk_invlists.pl b/regen/mk_invlists.pl index 460a72c..d6ff165 100644 --- a/regen/mk_invlists.pl +++ b/regen/mk_invlists.pl @@ -8,8 +8,8 @@ use Unicode::UCD qw(prop_aliases prop_invlist prop_invmap search_invlist ); -require 'regen/regen_lib.pl'; -require 'regen/charset_translations.pl'; +require './regen/regen_lib.pl'; +require './regen/charset_translations.pl'; # This program outputs charclass_invlists.h, which contains various inversion # lists in the form of C arrays that are to be used as-is for inversion lists. diff --git a/regen/opcode.pl b/regen/opcode.pl index edb9f4d..0bd62ce 100755 --- a/regen/opcode.pl +++ b/regen/opcode.pl @@ -20,7 +20,7 @@ use strict; BEGIN { # Get function prototypes - require 'regen/regen_lib.pl'; + require './regen/regen_lib.pl'; } my $oc = open_new('opcode.h', '>', @@ -924,7 +924,7 @@ package main; # which define what bits in op_private have what meanings for each op. # It populates %LABELS, %DEFINES, %FLAGS, %BITFIELDS. -require 'regen/op_private'; +require './regen/op_private'; #use Data::Dumper; #print Dumper \%LABELS, \%DEFINES, \%FLAGS, \%BITFIELDS; diff --git a/regen/overload.pl b/regen/overload.pl index c95ab2d..38dac32 100644 --- a/regen/overload.pl +++ b/regen/overload.pl @@ -16,7 +16,7 @@ BEGIN { # Get function prototypes - require 'regen/regen_lib.pl'; + require './regen/regen_lib.pl'; } use strict; diff --git a/regen/reentr.pl b/regen/reentr.pl index 3a0afaf..564a68f 100644 --- a/regen/reentr.pl +++ b/regen/reentr.pl @@ -18,7 +18,7 @@ BEGIN { # Get function prototypes - require 'regen/regen_lib.pl'; + require './regen/regen_lib.pl'; } use strict; diff --git a/regen/regcharclass.pl b/regen/regcharclass.pl index f3f8b99..c593334 100755 --- a/regen/regcharclass.pl +++ b/regen/regcharclass.pl @@ -11,8 +11,8 @@ our $hex_fmt= "0x%02X"; sub DEBUG () { 0 } $|=1 if DEBUG; -require 'regen/regen_lib.pl'; -require 'regen/charset_translations.pl'; +require './regen/regen_lib.pl'; +require './regen/charset_translations.pl'; require "regen/regcharclass_multi_char_folds.pl"; =head1 NAME diff --git a/regen/regcomp.pl b/regen/regcomp.pl index 850eeb9..94aa572 100644 --- a/regen/regcomp.pl +++ b/regen/regcomp.pl @@ -20,7 +20,7 @@ BEGIN { # Get function prototypes - require 'regen/regen_lib.pl'; + require './regen/regen_lib.pl'; } use strict; diff --git a/regen/uconfig_h.pl b/regen/uconfig_h.pl index 99a74f1..1c3d1b2 100755 --- a/regen/uconfig_h.pl +++ b/regen/uconfig_h.pl @@ -10,7 +10,7 @@ use strict; use Config; -require 'regen/regen_lib.pl'; +require './regen/regen_lib.pl'; my ($uconfig_h, $uconfig_h_new, $config_h_sh) = ('uconfig.h', 'uconfig.h-new', 'config_h.SH'); diff --git a/regen/unicode_constants.pl b/regen/unicode_constants.pl index acdbaa3..cbe3179 100644 --- a/regen/unicode_constants.pl +++ b/regen/unicode_constants.pl @@ -1,8 +1,8 @@ use v5.16.0; use strict; use warnings; -require 'regen/regen_lib.pl'; -require 'regen/charset_translations.pl'; +require './regen/regen_lib.pl'; +require './regen/charset_translations.pl'; use Unicode::UCD; use charnames qw(:loose); diff --git a/regen/warnings.pl b/regen/warnings.pl index 40e7265..739a7b4 100644 --- a/regen/warnings.pl +++ b/regen/warnings.pl @@ -19,7 +19,7 @@ $VERSION = '1.37'; BEGIN { - require 'regen/regen_lib.pl'; + require './regen/regen_lib.pl'; push @INC, './lib'; } use strict ; diff --git a/regen_perly.pl b/regen_perly.pl index f9ef04b..b8fb5d7 100644 --- a/regen_perly.pl +++ b/regen_perly.pl @@ -35,7 +35,7 @@ sub usage { die "usage: $0 [ -b bison_executable ] [ file.y ]\n" } use warnings; use strict; -BEGIN { require 'regen/regen_lib.pl'; } +BEGIN { require './regen/regen_lib.pl'; } my $bison = 'bison'; diff --git a/t/comp/line_debug.t b/t/comp/line_debug.t index 8361194..71626bb 100644 --- a/t/comp/line_debug.t +++ b/t/comp/line_debug.t @@ -1,5 +1,7 @@ #!./perl +BEGIN { unshift @INC, '.' } + chdir 't' if -d 't'; sub ok { diff --git a/t/lib/warnings/op b/t/lib/warnings/op index 8240dd6..e8d93e8 100644 --- a/t/lib/warnings/op +++ b/t/lib/warnings/op @@ -1453,6 +1453,7 @@ END { print "in end\n"; } print "in mainline\n"; 1; --FILE-- +BEGIN { unshift @INC, '.' } require abc; do "abc.pm"; EXPECT diff --git a/t/op/goto.t b/t/op/goto.t index 6be6413..05f1573 100644 --- a/t/op/goto.t +++ b/t/op/goto.t @@ -280,7 +280,7 @@ YYY: print "OK\n"; EOT close $f; -$r = runperl(prog => 'use Op_goto01; print qq[DONE\n]'); +$r = runperl(prog => 'BEGIN { unshift @INC, q[.] } use Op_goto01; print qq[DONE\n]'); is($r, "OK\nDONE\n", "goto within use-d file"); unlink_all "Op_goto01.pm"; diff --git a/t/porting/authors.t b/t/porting/authors.t index bc69e3a..563b92a 100644 --- a/t/porting/authors.t +++ b/t/porting/authors.t @@ -7,7 +7,7 @@ BEGIN { use TestInit qw(T); # T is chdir to the top level use strict; -require 't/test.pl'; +require './t/test.pl'; find_git_or_skip('all'); # This is the subset of "pretty=fuller" that checkAUTHORS.pl actually needs: diff --git a/t/porting/bench.t b/t/porting/bench.t index 527995a..bbebd37 100644 --- a/t/porting/bench.t +++ b/t/porting/bench.t @@ -8,7 +8,7 @@ BEGIN { use TestInit qw(T A); # T is chdir to the top level, A makes paths absolute use strict; -require 't/test.pl'; +require './t/test.pl'; my $source = find_git_or_skip('all'); chdir $source or die "Can't chdir to $source: $!"; diff --git a/t/porting/cmp_version.t b/t/porting/cmp_version.t index 55b4003..bbbc852 100644 --- a/t/porting/cmp_version.t +++ b/t/porting/cmp_version.t @@ -16,7 +16,7 @@ BEGIN { use TestInit qw(T A); # T is chdir to the top level, A makes paths absolute use strict; -require 't/test.pl'; +require './t/test.pl'; my $source = find_git_or_skip('all'); chdir $source or die "Can't chdir to $source: $!"; diff --git a/t/porting/corelist.t b/t/porting/corelist.t index 251a260..820ff3e 100644 --- a/t/porting/corelist.t +++ b/t/porting/corelist.t @@ -6,7 +6,7 @@ use TestInit qw(T); use strict; use Config; -require 't/test.pl'; +require './t/test.pl'; plan(tests => 6); diff --git a/t/porting/diag.t b/t/porting/diag.t index ccde8cb..cdd9d64 100644 --- a/t/porting/diag.t +++ b/t/porting/diag.t @@ -9,7 +9,7 @@ use warnings; use strict; use Config; -require 't/test.pl'; +require './t/test.pl'; if ( $Config{usecrosscompile} ) { skip_all( "Not all files are available during cross-compilation" ); @@ -26,7 +26,7 @@ plan('no_plan'); my $make_exceptions_list = ($ARGV[0]||'') eq '--make-exceptions-list' and shift; -require 'regen/embed_lib.pl'; +require './regen/embed_lib.pl'; # Look for functions that look like they could be diagnostic ones. my @functions; diff --git a/t/porting/globvar.t b/t/porting/globvar.t index 8dd45ba..605eba0 100644 --- a/t/porting/globvar.t +++ b/t/porting/globvar.t @@ -4,7 +4,7 @@ use TestInit qw(T); use strict; use Config; -require 't/test.pl'; +require './t/test.pl'; skip_all("Code to read symbols not ported to $^O") if $^O eq 'VMS' or $^O eq 'MSWin32'; diff --git a/t/porting/manifest.t b/t/porting/manifest.t index b0dd440..7adb061 100644 --- a/t/porting/manifest.t +++ b/t/porting/manifest.t @@ -30,7 +30,7 @@ BEGIN { } use TestInit qw(T); # T is chdir to the top level -require 't/test.pl'; +require './t/test.pl'; skip_all("Cross-compiling, the entire source might not be available") if $Config{usecrosscompile}; diff --git a/t/porting/pending-author.t b/t/porting/pending-author.t index 4dceaf6..0aaa546 100644 --- a/t/porting/pending-author.t +++ b/t/porting/pending-author.t @@ -27,7 +27,7 @@ use TestInit qw(T); # T is chdir to the top level use strict; use File::Spec; -require 't/test.pl'; +require './t/test.pl'; find_git_or_skip('all'); my $devnull = File::Spec->devnull; diff --git a/t/porting/pod_rules.t b/t/porting/pod_rules.t index 46a0114..894b153 100644 --- a/t/porting/pod_rules.t +++ b/t/porting/pod_rules.t @@ -25,7 +25,7 @@ BEGIN { chdir '..'; } @INC = qw(lib .); # Special @INC. - require 't/test.pl'; + require './t/test.pl'; } use strict; diff --git a/t/porting/readme.t b/t/porting/readme.t index e127920..232a45f 100644 --- a/t/porting/readme.t +++ b/t/porting/readme.t @@ -10,7 +10,7 @@ BEGIN { use TestInit qw(T); # T is chdir to the top level use strict; use warnings; -require 't/test.pl'; +require './t/test.pl'; my @porting_files; open my $man, "MANIFEST" or die "Can't open MANIFEST: $!"; diff --git a/t/porting/regen.t b/t/porting/regen.t index 5d08518..3aa1fd5 100644 --- a/t/porting/regen.t +++ b/t/porting/regen.t @@ -8,8 +8,8 @@ BEGIN { use TestInit qw(T A); # T is chdir to the top level, A makes paths absolute use strict; -require 'regen/regen_lib.pl'; -require 't/test.pl'; +require './regen/regen_lib.pl'; +require './t/test.pl'; $::NO_ENDING = $::NO_ENDING = 1; if ( $^O eq "VMS" ) { @@ -86,7 +86,7 @@ OUTER: foreach my $file (@files) { } foreach (@progs) { - my $command = "$^X $_ --tap"; + my $command = "$^X -I. $_ --tap"; system $command and die "Failed to run $command: $?"; } diff --git a/t/porting/utils.t b/t/porting/utils.t index 475380d..92eafbd 100644 --- a/t/porting/utils.t +++ b/t/porting/utils.t @@ -22,7 +22,7 @@ BEGIN { use TestInit qw(T); # T is chdir to the top level use strict; -require 't/test.pl'; +require './t/test.pl'; # It turns out that, since the default @INC will include your old 5.x libs, if # you have them, the Porting utils might load a library that no longer compiles diff --git a/t/re/pat.t b/t/re/pat.t index eb321e9..b8d7680 100644 --- a/t/re/pat.t +++ b/t/re/pat.t @@ -1699,7 +1699,7 @@ EOP # NOTE - Do not put quotes in the code! # NOTE - We have to triple escape the backref in the pattern below. my $code=' - BEGIN{require q(test.pl);} + BEGIN{require q(./test.pl);} watchdog(3); for my $len (1 .. 20) { my $eights= q(8) x $len; @@ -1715,7 +1715,7 @@ EOP # #123562] my $code=' - BEGIN{require q(test.pl);} + BEGIN{require q(./test.pl);} use Encode qw(_utf8_on); # \x80 and \x41 are continuation bytes in their respective # character sets @@ -1783,7 +1783,7 @@ EOP my ($expr, $expect, $test_name, $cap1)= @$tuple; # avoid quotes in this code! my $code=' - BEGIN{require q(test.pl);} + BEGIN{require q(./test.pl);} watchdog(3); my $status= eval(q{ !(' . $expr . ') ? q(failed) : ' . ($cap1 ? '($1 ne q['.$cap1.']) ? qq(badmatch:$1) : ' : '') . diff --git a/t/run/runenv.t b/t/run/runenv.t index 82846a4..8861a3d 100644 --- a/t/run/runenv.t +++ b/t/run/runenv.t @@ -285,7 +285,8 @@ is ($err, '', 'No errors when determining @INC'); my @default_inc = split /\n/, $out; -is ($default_inc[-1], '.', '. is last in @INC'); +ok ! grep { $_ eq '.' } @default_inc, '. is not in @INC'; +#is ($default_inc[-1], '.', '. is last in @INC'); my $sep = $Config{path_sep}; foreach (['nothing', ''], diff --git a/t/run/switches.t b/t/run/switches.t index 0018a74..b61be56 100644 --- a/t/run/switches.t +++ b/t/run/switches.t @@ -194,12 +194,12 @@ sub import { print map "<\$_>", \@_ } SWTESTPM close $f or die "Could not close: $!"; $r = runperl( - switches => [ "-M$package" ], + switches => [ "-I.", "-M$package" ], prog => '1', ); is( $r, "<$package>", '-M' ); $r = runperl( - switches => [ "-M$package=foo" ], + switches => [ "-I.", "-M$package=foo" ], prog => '1', ); is( $r, "<$package>", '-M with import parameter' ); @@ -213,7 +213,7 @@ SWTESTPM is( $r, '', '-m' ); } $r = runperl( - switches => [ "-m$package=foo,bar" ], + switches => [ "-I.", "-m$package=foo,bar" ], prog => '1', ); is( $r, "<$package>", '-m with import parameters' ); diff --git a/t/test.pl b/t/test.pl index 349bcc9..de2ada0 100644 --- a/t/test.pl +++ b/t/test.pl @@ -652,7 +652,7 @@ sub _create_runperl { # Create the string to qx in runperl(). $runperl = "$ENV{PERL_RUNPERL_DEBUG} $runperl"; } unless ($args{nolib}) { - $runperl = $runperl . ' "-I../lib"'; # doublequotes because of VMS + $runperl = $runperl . ' "-I../lib" "-I." '; # doublequotes because of VMS } if ($args{switches}) { local $Level = 2; @@ -1261,6 +1261,7 @@ sub run_multiple_progs { open my $fh, '>', $tmpfile or die "Cannot open >$tmpfile: $!"; print $fh q{ BEGIN { + push @INC, '.'; open STDERR, '>&', STDOUT or die "Can't dup STDOUT->STDERR: $!;"; } diff --git a/utils/Makefile.PL b/utils/Makefile.PL index 27c371f..85b0833 100644 --- a/utils/Makefile.PL +++ b/utils/Makefile.PL @@ -13,7 +13,7 @@ if (@ARGV) { # attempting to move the work from them to the extension directories and # ExtUtils::MakeMaker. -require 'regen/regen_lib.pl'; +require './regen/regen_lib.pl'; my $target = 'utils/Makefile'; print "Extracting $target (with variable substitutions)\n"; diff --git a/utils/c2ph.PL b/utils/c2ph.PL index ea87a6f..c5b5a3f 100644 --- a/utils/c2ph.PL +++ b/utils/c2ph.PL @@ -198,8 +198,8 @@ them in terms of packages and functions. Consider the following program: #!/usr/local/bin/perl require 'syscall.ph'; - require 'sys/time.ph'; - require 'sys/resource.ph'; + require './sys/time.ph'; + require './sys/resource.ph'; $ru = "\0" x &rusage'sizeof(); diff --git a/utils/perlivp.PL b/utils/perlivp.PL index e522913..81f8ae4 100644 --- a/utils/perlivp.PL +++ b/utils/perlivp.PL @@ -231,7 +231,7 @@ if (defined($Config{'extensions'})) { next if $_ eq 'XS/APItest'; next if $_ eq 'XS/Typemap'; # VMS$ perl -e "eval ""require \""Devel/DProf.pm\"";"" print $@" - # \NT> perl -e "eval \"require 'Devel/DProf.pm'\"; print $@" + # \NT> perl -e "eval \"require './Devel/DProf.pm'\"; print $@" # DProf: run perl with -d to use DProf. # Compilation failed in require at (eval 1) line 1. eval " require \"$_.pm\"; "; -- 1.8.3.1