Skip to content

Commit

Permalink
do not rely on '.' being in @inc
Browse files Browse the repository at this point in the history
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
  • Loading branch information
plicease authored and wchristian committed Dec 6, 2016
1 parent addc11f commit b9023e7
Show file tree
Hide file tree
Showing 67 changed files with 149 additions and 85 deletions.
1 change: 1 addition & 0 deletions Makefile.PL
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use strict;
use warnings;

use lib '.';
use inc::Module::Install 1.10;

all_from 'lib/PPI.pm';
Expand Down
3 changes: 2 additions & 1 deletion t/01_compile.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

# This test script only tests that the tree compiles

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


Expand Down
3 changes: 2 additions & 1 deletion t/03_document.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

# PPI::Document tests

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

use File::Spec::Functions ':ALL';
Expand Down
5 changes: 3 additions & 2 deletions t/04_element.t
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
# This does an empiric test that when we try to parse something,
# something ( anything ) comes out the other side.

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

use File::Spec::Functions ':ALL';
use PPI;
use Scalar::Util 'refaddr';
use t::lib::PPI::Test 'pause';
use PPI::Test 'pause';


sub is_object {
Expand Down
7 changes: 4 additions & 3 deletions t/05_lexer.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
# Compare a large number of specific code samples (.code)
# with the expected Lexer dumps (.dump).

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

use File::Spec::Functions ':ALL';
use PPI::Lexer;
use t::lib::PPI::Test::Run;
use PPI::Test::Run;

#####################################################################
# Code/Dump Testing

t::lib::PPI::Test::Run->run_testdir( catdir( 't', 'data', '05_lexer' ) );
PPI::Test::Run->run_testdir( catdir( 't', 'data', '05_lexer' ) );
5 changes: 3 additions & 2 deletions t/06_round_trip.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
# Load ALL of the PPI files, lex them in, dump them
# out, and verify that the code goes in and out cleanly.

use t::lib::PPI::Test::pragmas;
use lib 't/lib';
use PPI::Test::pragmas;
use Test::More; # Plan comes later

use File::Spec::Functions ':ALL';
use PPI;
use t::lib::PPI::Test 'find_files';
use PPI::Test 'find_files';



Expand Down
9 changes: 5 additions & 4 deletions t/07_token.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

# Formal unit tests for specific PPI::Token classes

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

use File::Spec::Functions ':ALL';
use PPI;
use t::lib::PPI::Test::Run;
use PPI::Test::Run;



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

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

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


Expand Down
9 changes: 5 additions & 4 deletions t/08_regression.t
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,20 @@

# Some other regressions tests are included here for simplicity.

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

use PPI;
use t::lib::PPI::Test 'pause';
use t::lib::PPI::Test::Run;
use PPI::Test 'pause';
use PPI::Test::Run;



#####################################################################
# Code/Dump Testing

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



Expand Down
3 changes: 2 additions & 1 deletion t/09_normal.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
# Testing of the normalization functions.
# (only very basic at this point)

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

use File::Spec::Functions ':ALL';
Expand Down
3 changes: 2 additions & 1 deletion t/10_statement.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

# Test the various PPI::Statement packages

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

use PPI;
Expand Down
3 changes: 2 additions & 1 deletion t/11_util.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

# Test the PPI::Util package

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

use File::Spec::Functions ':ALL';
Expand Down
3 changes: 2 additions & 1 deletion t/12_location.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

# Tests the accuracy and features for location functionality

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

use PPI;
Expand Down
3 changes: 2 additions & 1 deletion t/13_data.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

# Tests functionality relating to __DATA__ sections of files

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

use File::Spec::Functions ':ALL';
Expand Down
3 changes: 2 additions & 1 deletion t/14_charsets.t
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/perl

use t::lib::PPI::Test::pragmas;
use lib 't/lib';
use PPI::Test::pragmas;
use Test::More;
BEGIN {
if ($] < 5.008007) {
Expand Down
3 changes: 2 additions & 1 deletion t/15_transform.t
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/perl

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

use File::Spec::Functions ':ALL';
Expand Down
3 changes: 2 additions & 1 deletion t/16_xml.t
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/perl

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

use PPI;
Expand Down
3 changes: 2 additions & 1 deletion t/17_storable.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

# Test compatibility with Storable

use t::lib::PPI::Test::pragmas;
use lib 't/lib';
use PPI::Test::pragmas;
use Test::More;
BEGIN {
# Is Storable installed?
Expand Down
3 changes: 2 additions & 1 deletion t/18_cache.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

# Test PPI::Cache

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

use File::Spec::Unix;
Expand Down
7 changes: 4 additions & 3 deletions t/19_selftesting.t
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@

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

use t::lib::PPI::Test::pragmas;
use lib 't/lib';
use PPI::Test::pragmas;
use Test::More; # Plan comes later

use Test::Object;
use File::Spec::Functions ':ALL';
use Params::Util qw{_CLASS _ARRAY _INSTANCE _IDENTIFIER};
use Class::Inspector;
use PPI;
use t::lib::PPI::Test 'find_files';
use t::lib::PPI::Test::Object;
use PPI::Test 'find_files';
use PPI::Test::Object;

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

Expand Down
5 changes: 3 additions & 2 deletions t/21_exhaustive.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

# Exhaustively test all possible Perl programs to a particular length

use t::lib::PPI::Test::pragmas;
use lib 't/lib';
use PPI::Test::pragmas;
use Test::More; # Plan comes later

use Params::Util qw{_INSTANCE};
use PPI;
use t::lib::PPI::Test 'quotable';
use PPI::Test 'quotable';

use vars qw{$MAX_CHARS $ITERATIONS $LENGTH @ALL_CHARS @FAILURES};
BEGIN {
Expand Down
3 changes: 2 additions & 1 deletion t/22_readonly.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

# Testing of readonly functionality

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

use PPI::Document;
Expand Down
3 changes: 2 additions & 1 deletion t/23_file.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

# Testing of PPI::Document::File

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

use File::Spec::Functions ':ALL';
Expand Down
3 changes: 2 additions & 1 deletion t/24_v6.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
# Regression test of a Perl 5 grammar that exploded
# with a "98 subroutine recursion" error in 1.201

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

use File::Spec::Functions ':ALL';
Expand Down
7 changes: 4 additions & 3 deletions t/25_increment.t
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
# state between an empty document and the entire file to make sure
# all of them parse as legal documents and don't crash the parser.

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

use PPI;
use t::lib::PPI::Test::Run;
use PPI::Test::Run;



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

t::lib::PPI::Test::Run->increment_testdir(qw{ t data 08_regression });
PPI::Test::Run->increment_testdir(qw{ t data 08_regression });
7 changes: 4 additions & 3 deletions t/26_bom.t
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#!/usr/bin/perl

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

use t::lib::PPI::Test::Run;
use PPI::Test::Run;



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

t::lib::PPI::Test::Run->run_testdir(qw{ t data 26_bom });
PPI::Test::Run->run_testdir(qw{ t data 26_bom });
5 changes: 3 additions & 2 deletions t/27_complete.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

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

use t::lib::PPI::Test::pragmas;
use lib 't/lib';
use PPI::Test::pragmas;
use Test::More; # Plan comes later

use File::Spec::Functions ':ALL';
use PPI;
use t::lib::PPI::Test 'find_files';
use PPI::Test 'find_files';

# This test uses a series of ordered files, containing test code.
# The letter after the number acts as a boolean yes/no answer to
Expand Down
3 changes: 2 additions & 1 deletion t/28_foreach_qw.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

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

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

#use File::Spec::Functions ':ALL';
Expand Down
3 changes: 2 additions & 1 deletion t/interactive.t
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
# Testing it here is much more efficient than having to trace
# down through the entire set of regression tests.

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

use PPI;
Expand Down
2 changes: 1 addition & 1 deletion t/lib/PPI/Test.pm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package t::lib::PPI::Test;
package PPI::Test;

use warnings;
use strict;
Expand Down
2 changes: 1 addition & 1 deletion t/lib/PPI/Test/Object.pm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package t::lib::PPI::Test::Object;
package PPI::Test::Object;

use warnings;
use strict;
Expand Down
Loading

0 comments on commit b9023e7

Please sign in to comment.