Subject: | Tests fail when no '.' in @INC ( Can't locate t/08-redirect.pl in @INC ) |
I observe you have existing attempts at fixing tests for this, but alas, it wasn't enough.
Unfortunately, 'require "t/foo.pl" ' *also* triggers @INC traversal.
The only way to subvert @INC lookup is to either
a: Use a fully qualified path
b: Use a path with a leading "./"
Both of these are special cased.
Compare the results of running the tests directly vs with "legacy compat mode" enabled.
perl -Mblib=blib t/08-redirect.t
Can't locate t/08-redirect.pl in @INC (@INC contains: /home/kent/.cpanm/work/1493468674.30124/IO-Pager-0.37/blib/arch /home/kent/.cpanm/work/1493468674.30124/IO-Pager-0.37/blib/lib /home/kent/perl5/perlbrew/perls/5.25.12-nossp-sip13-nopmc-nodot/lib/site_perl/5.25.12/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.12-nossp-sip13-nopmc-nodot/lib/site_perl/5.25.12 /home/kent/perl5/perlbrew/perls/5.25.12-nossp-sip13-nopmc-nodot/lib/5.25.12/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.12-nossp-sip13-nopmc-nodot/lib/5.25.12) at -e line 1.
Can't locate t/08-redirect.pl in @INC (@INC contains: blib/arch blib/lib /home/kent/perl5/perlbrew/perls/5.25.12-nossp-sip13-nopmc-nodot/lib/site_perl/5.25.12/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.12-nossp-sip13-nopmc-nodot/lib/site_perl/5.25.12 /home/kent/perl5/perlbrew/perls/5.25.12-nossp-sip13-nopmc-nodot/lib/5.25.12/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.12-nossp-sip13-nopmc-nodot/lib/5.25.12) at t/08-redirect.t line 20, <TMP> chunk 1.
PERL_USE_UNSAFE_INC=1 perl -Mblib=blib t/08-redirect.t
ok 1 - Redirection (IO::Pager::Page)
1..1
perl -Mblib=blib t/11-redirect-oo.t
Can't locate t/08-redirect.pl in @INC (@INC contains: /home/kent/.cpanm/work/1493468674.30124/IO-Pager-0.37/blib/arch /home/kent/.cpanm/work/1493468674.30124/IO-Pager-0.37/blib/lib /home/kent/perl5/perlbrew/perls/5.25.12-nossp-sip13-nopmc-nodot/lib/site_perl/5.25.12/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.12-nossp-sip13-nopmc-nodot/lib/site_perl/5.25.12 /home/kent/perl5/perlbrew/perls/5.25.12-nossp-sip13-nopmc-nodot/lib/5.25.12/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.12-nossp-sip13-nopmc-nodot/lib/5.25.12) at t/11-redirect-oo.pl line 4.
Can't locate t/08-redirect.pl in @INC (@INC contains: blib/arch blib/lib /home/kent/perl5/perlbrew/perls/5.25.12-nossp-sip13-nopmc-nodot/lib/site_perl/5.25.12/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.12-nossp-sip13-nopmc-nodot/lib/site_perl/5.25.12 /home/kent/perl5/perlbrew/perls/5.25.12-nossp-sip13-nopmc-nodot/lib/5.25.12/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.12-nossp-sip13-nopmc-nodot/lib/5.25.12) at t/11-redirect-oo.t line 26, <TMP> chunk 1.
PERL_USE_UNSAFE_INC=1 perl -Mblib=blib t/11-redirect-oo.t
ok 1 - Redirection with OO
1..1
The attached patch as proof of concept should fix t/08-redirect.t , but 11-redirect-oo.t still needs its own fix.
Please make sure to run
PERL_USE_UNSAFE_INC=0 make test
on Perl 5.25.11+ when done to defeat TAP::Harness auto-magically hiding failures ( it internally sets PERL_UNSAFE_INC=1 if its not set )
- CPAN kentnl@cpan.org
- Gentoo Perl Maintainer kentnl@gentoo.org ( perl@gentoo.org )
Subject: | redirect.patch |