Skip to content

Commit

Permalink
Fix test failures on Perl 5.26 w/ PERL_USE_UNSAFE_INC=0
Browse files Browse the repository at this point in the history
Perl 5.26+ removes '.' from the default @inc, and this breaks the
mechanism internally where @INC-prefixes are stripped from fid_fileinfo
names ( in ::FileInfo.pm ).

This breaks tests due to the sample 'rdt' files expecting single-token
comparators relative to 't/', instead getting a fully qualified path in
the "got" side of the test.

This remedies this by ensuring a fully-qualified path to "t/" is in
@inc for the aforementioned prefix-stripper to pick-up on.

Closes: #108
Bug: https://bugs.gentoo.org/615734
  • Loading branch information
kentfredric committed Oct 7, 2017
1 parent 15d7247 commit 43e1549
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions t/lib/NYTProfTest.pm
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ my $text_extn_info = {
pf => { order => 50, tests => 2, },
};

# having t/* in @INC is necessary for prefix-stripping
# to reduce test-file names down to the single tokens
# that are used in the comparison-output files.
unshift @INC, File::Spec->rel2abs('./t') if -d 't';
chdir('t') if -d 't';

if (-d '../blib') {
Expand Down

0 comments on commit 43e1549

Please sign in to comment.