Skip to content

Commit b9023e7

Browse files
pliceasewchristian
authored andcommitted
do not rely on '.' being in @inc
As of 5.25.7, Perl can be configured to not include '.' in @inc by default. Update Makefile to use lib '.' so that it can find Module::Install on systems that do not have it already (and use the local version in preference to the system in versions that do). Also rename the tests in 't/lib' and add *just* that directory to @inc. fixes #196
1 parent addc11f commit b9023e7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+149
-85
lines changed

Makefile.PL

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use strict;
22
use warnings;
33

4+
use lib '.';
45
use inc::Module::Install 1.10;
56

67
all_from 'lib/PPI.pm';

t/01_compile.t

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
# This test script only tests that the tree compiles
44

5-
use t::lib::PPI::Test::pragmas;
5+
use lib 't/lib';
6+
use PPI::Test::pragmas;
67
use Test::More tests => 17 + ($ENV{AUTHOR_TESTING} ? 1 : 0);
78

89

t/03_document.t

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
# PPI::Document tests
44

5-
use t::lib::PPI::Test::pragmas;
5+
use lib 't/lib';
6+
use PPI::Test::pragmas;
67
use Test::More tests => 13 + ($ENV{AUTHOR_TESTING} ? 1 : 0);
78

89
use File::Spec::Functions ':ALL';

t/04_element.t

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@
55
# This does an empiric test that when we try to parse something,
66
# something ( anything ) comes out the other side.
77

8-
use t::lib::PPI::Test::pragmas;
8+
use lib 't/lib';
9+
use PPI::Test::pragmas;
910
use Test::More tests => 220 + ($ENV{AUTHOR_TESTING} ? 1 : 0);
1011

1112
use File::Spec::Functions ':ALL';
1213
use PPI;
1314
use Scalar::Util 'refaddr';
14-
use t::lib::PPI::Test 'pause';
15+
use PPI::Test 'pause';
1516

1617

1718
sub is_object {

t/05_lexer.t

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@
33
# Compare a large number of specific code samples (.code)
44
# with the expected Lexer dumps (.dump).
55

6-
use t::lib::PPI::Test::pragmas;
6+
use lib 't/lib';
7+
use PPI::Test::pragmas;
78
use Test::More tests => 218 + ($ENV{AUTHOR_TESTING} ? 1 : 0);
89

910
use File::Spec::Functions ':ALL';
1011
use PPI::Lexer;
11-
use t::lib::PPI::Test::Run;
12+
use PPI::Test::Run;
1213

1314
#####################################################################
1415
# Code/Dump Testing
1516

16-
t::lib::PPI::Test::Run->run_testdir( catdir( 't', 'data', '05_lexer' ) );
17+
PPI::Test::Run->run_testdir( catdir( 't', 'data', '05_lexer' ) );

t/06_round_trip.t

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@
33
# Load ALL of the PPI files, lex them in, dump them
44
# out, and verify that the code goes in and out cleanly.
55

6-
use t::lib::PPI::Test::pragmas;
6+
use lib 't/lib';
7+
use PPI::Test::pragmas;
78
use Test::More; # Plan comes later
89

910
use File::Spec::Functions ':ALL';
1011
use PPI;
11-
use t::lib::PPI::Test 'find_files';
12+
use PPI::Test 'find_files';
1213

1314

1415

t/07_token.t

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22

33
# Formal unit tests for specific PPI::Token classes
44

5-
use t::lib::PPI::Test::pragmas;
5+
use lib 't/lib';
6+
use PPI::Test::pragmas;
67
use Test::More tests => 570 + ($ENV{AUTHOR_TESTING} ? 1 : 0);
78

89
use File::Spec::Functions ':ALL';
910
use PPI;
10-
use t::lib::PPI::Test::Run;
11+
use PPI::Test::Run;
1112

1213

1314

@@ -16,11 +17,11 @@ use t::lib::PPI::Test::Run;
1617
#####################################################################
1718
# Code/Dump Testing
1819

19-
t::lib::PPI::Test::Run->run_testdir( catdir( 't', 'data', '07_token' ) );
20+
PPI::Test::Run->run_testdir( catdir( 't', 'data', '07_token' ) );
2021

2122
{
2223
local $ENV{TODO} = "known bug";
23-
t::lib::PPI::Test::Run->run_testdir( catdir( 't', 'data', '07_token_todo' ) );
24+
PPI::Test::Run->run_testdir( catdir( 't', 'data', '07_token_todo' ) );
2425
}
2526

2627

t/08_regression.t

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,20 @@
44

55
# Some other regressions tests are included here for simplicity.
66

7-
use t::lib::PPI::Test::pragmas;
7+
use lib 't/lib';
8+
use PPI::Test::pragmas;
89
use Test::More tests => 925 + ($ENV{AUTHOR_TESTING} ? 1 : 0);
910

1011
use PPI;
11-
use t::lib::PPI::Test 'pause';
12-
use t::lib::PPI::Test::Run;
12+
use PPI::Test 'pause';
13+
use PPI::Test::Run;
1314

1415

1516

1617
#####################################################################
1718
# Code/Dump Testing
1819

19-
t::lib::PPI::Test::Run->run_testdir(qw{ t data 08_regression });
20+
PPI::Test::Run->run_testdir(qw{ t data 08_regression });
2021

2122

2223

t/09_normal.t

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
# Testing of the normalization functions.
44
# (only very basic at this point)
55

6-
use t::lib::PPI::Test::pragmas;
6+
use lib 't/lib';
7+
use PPI::Test::pragmas;
78
use Test::More tests => 17 + ($ENV{AUTHOR_TESTING} ? 1 : 0);
89

910
use File::Spec::Functions ':ALL';

t/10_statement.t

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
# Test the various PPI::Statement packages
44

5-
use t::lib::PPI::Test::pragmas;
5+
use lib 't/lib';
6+
use PPI::Test::pragmas;
67
use Test::More tests => 5 + ($ENV{AUTHOR_TESTING} ? 1 : 0);
78

89
use PPI;

t/11_util.t

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
# Test the PPI::Util package
44

5-
use t::lib::PPI::Test::pragmas;
5+
use lib 't/lib';
6+
use PPI::Test::pragmas;
67
use Test::More tests => 10 + ($ENV{AUTHOR_TESTING} ? 1 : 0);
78

89
use File::Spec::Functions ':ALL';

t/12_location.t

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
# Tests the accuracy and features for location functionality
44

5-
use t::lib::PPI::Test::pragmas;
5+
use lib 't/lib';
6+
use PPI::Test::pragmas;
67
use Test::More tests => 682 + ($ENV{AUTHOR_TESTING} ? 1 : 0);
78

89
use PPI;

t/13_data.t

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
# Tests functionality relating to __DATA__ sections of files
44

5-
use t::lib::PPI::Test::pragmas;
5+
use lib 't/lib';
6+
use PPI::Test::pragmas;
67
use Test::More tests => 7 + ($ENV{AUTHOR_TESTING} ? 1 : 0);
78

89
use File::Spec::Functions ':ALL';

t/14_charsets.t

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/perl
22

3-
use t::lib::PPI::Test::pragmas;
3+
use lib 't/lib';
4+
use PPI::Test::pragmas;
45
use Test::More;
56
BEGIN {
67
if ($] < 5.008007) {

t/15_transform.t

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/perl
22

3-
use t::lib::PPI::Test::pragmas;
3+
use lib 't/lib';
4+
use PPI::Test::pragmas;
45
use Test::More 0.86 tests => 24 + ($ENV{AUTHOR_TESTING} ? 1 : 0);
56

67
use File::Spec::Functions ':ALL';

t/16_xml.t

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/perl
22

3-
use t::lib::PPI::Test::pragmas;
3+
use lib 't/lib';
4+
use PPI::Test::pragmas;
45
use Test::More 0.86 tests => 16 + ($ENV{AUTHOR_TESTING} ? 1 : 0);
56

67
use PPI;

t/17_storable.t

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
# Test compatibility with Storable
44

5-
use t::lib::PPI::Test::pragmas;
5+
use lib 't/lib';
6+
use PPI::Test::pragmas;
67
use Test::More;
78
BEGIN {
89
# Is Storable installed?

t/18_cache.t

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
# Test PPI::Cache
44

5-
use t::lib::PPI::Test::pragmas;
5+
use lib 't/lib';
6+
use PPI::Test::pragmas;
67
use Test::More tests => 42 + ($ENV{AUTHOR_TESTING} ? 1 : 0);
78

89
use File::Spec::Unix;

t/19_selftesting.t

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,17 @@
55

66
# Using PPI to analyse its own code at install-time? Fuck yeah! :)
77

8-
use t::lib::PPI::Test::pragmas;
8+
use lib 't/lib';
9+
use PPI::Test::pragmas;
910
use Test::More; # Plan comes later
1011

1112
use Test::Object;
1213
use File::Spec::Functions ':ALL';
1314
use Params::Util qw{_CLASS _ARRAY _INSTANCE _IDENTIFIER};
1415
use Class::Inspector;
1516
use PPI;
16-
use t::lib::PPI::Test 'find_files';
17-
use t::lib::PPI::Test::Object;
17+
use PPI::Test 'find_files';
18+
use PPI::Test::Object;
1819

1920
use constant CI => 'Class::Inspector';
2021

t/21_exhaustive.t

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22

33
# Exhaustively test all possible Perl programs to a particular length
44

5-
use t::lib::PPI::Test::pragmas;
5+
use lib 't/lib';
6+
use PPI::Test::pragmas;
67
use Test::More; # Plan comes later
78

89
use Params::Util qw{_INSTANCE};
910
use PPI;
10-
use t::lib::PPI::Test 'quotable';
11+
use PPI::Test 'quotable';
1112

1213
use vars qw{$MAX_CHARS $ITERATIONS $LENGTH @ALL_CHARS @FAILURES};
1314
BEGIN {

t/22_readonly.t

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
# Testing of readonly functionality
44

5-
use t::lib::PPI::Test::pragmas;
5+
use lib 't/lib';
6+
use PPI::Test::pragmas;
67
use Test::More tests => 8 + ($ENV{AUTHOR_TESTING} ? 1 : 0);
78

89
use PPI::Document;

t/23_file.t

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
# Testing of PPI::Document::File
44

5-
use t::lib::PPI::Test::pragmas;
5+
use lib 't/lib';
6+
use PPI::Test::pragmas;
67
use Test::More tests => 4 + ($ENV{AUTHOR_TESTING} ? 1 : 0);
78

89
use File::Spec::Functions ':ALL';

t/24_v6.t

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
# Regression test of a Perl 5 grammar that exploded
44
# with a "98 subroutine recursion" error in 1.201
55

6-
use t::lib::PPI::Test::pragmas;
6+
use lib 't/lib';
7+
use PPI::Test::pragmas;
78
use Test::More tests => 8 + ($ENV{AUTHOR_TESTING} ? 1 : 0);
89

910
use File::Spec::Functions ':ALL';

t/25_increment.t

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@
55
# state between an empty document and the entire file to make sure
66
# all of them parse as legal documents and don't crash the parser.
77

8-
use t::lib::PPI::Test::pragmas;
8+
use lib 't/lib';
9+
use PPI::Test::pragmas;
910
use Test::More tests => 3875 + ($ENV{AUTHOR_TESTING} ? 1 : 0);
1011

1112
use PPI;
12-
use t::lib::PPI::Test::Run;
13+
use PPI::Test::Run;
1314

1415

1516

@@ -18,4 +19,4 @@ use t::lib::PPI::Test::Run;
1819
#####################################################################
1920
# Code/Dump Testing
2021

21-
t::lib::PPI::Test::Run->increment_testdir(qw{ t data 08_regression });
22+
PPI::Test::Run->increment_testdir(qw{ t data 08_regression });

t/26_bom.t

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
#!/usr/bin/perl
22

3-
use t::lib::PPI::Test::pragmas;
3+
use lib 't/lib';
4+
use PPI::Test::pragmas;
45
use Test::More tests => 20 + ($ENV{AUTHOR_TESTING} ? 1 : 0);
56

6-
use t::lib::PPI::Test::Run;
7+
use PPI::Test::Run;
78

89

910

@@ -12,4 +13,4 @@ use t::lib::PPI::Test::Run;
1213
#####################################################################
1314
# Code/Dump Testing
1415

15-
t::lib::PPI::Test::Run->run_testdir(qw{ t data 26_bom });
16+
PPI::Test::Run->run_testdir(qw{ t data 26_bom });

t/27_complete.t

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22

33
# Testing for the PPI::Document ->complete method
44

5-
use t::lib::PPI::Test::pragmas;
5+
use lib 't/lib';
6+
use PPI::Test::pragmas;
67
use Test::More; # Plan comes later
78

89
use File::Spec::Functions ':ALL';
910
use PPI;
10-
use t::lib::PPI::Test 'find_files';
11+
use PPI::Test 'find_files';
1112

1213
# This test uses a series of ordered files, containing test code.
1314
# The letter after the number acts as a boolean yes/no answer to

t/28_foreach_qw.t

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
# Standalone tests to check "foreach qw{foo} {}"
44

5-
use t::lib::PPI::Test::pragmas;
5+
use lib 't/lib';
6+
use PPI::Test::pragmas;
67
use Test::More tests => 12 + ($ENV{AUTHOR_TESTING} ? 1 : 0);
78

89
#use File::Spec::Functions ':ALL';

t/interactive.t

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
# Testing it here is much more efficient than having to trace
55
# down through the entire set of regression tests.
66

7-
use t::lib::PPI::Test::pragmas;
7+
use lib 't/lib';
8+
use PPI::Test::pragmas;
89
use Test::More tests => 2 + ($ENV{AUTHOR_TESTING} ? 1 : 0);
910

1011
use PPI;

t/lib/PPI/Test.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package t::lib::PPI::Test;
1+
package PPI::Test;
22

33
use warnings;
44
use strict;

t/lib/PPI/Test/Object.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package t::lib::PPI::Test::Object;
1+
package PPI::Test::Object;
22

33
use warnings;
44
use strict;

0 commit comments

Comments
 (0)