From: Peter Rabbitson Date: Sun, 11 Oct 2015 03:14:01 +0000 (+0200) Subject: Get tests running under -T (cosmetics only) X-Git-Tag: 0.27~10 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=726710b68a0754b5d5a7c9c5a054ace00bbdb22c;p=p5sagit%2Fnamespace-clean.git Get tests running under -T (cosmetics only) --- diff --git a/t/00-basic.t b/t/00-basic.t index 80ba682..0d5718d 100644 --- a/t/00-basic.t +++ b/t/00-basic.t @@ -1,9 +1,7 @@ -#!/usr/bin/env perl use warnings; use strict; -use FindBin; -use lib "$FindBin::Bin/lib"; +use lib 't/lib'; use Test::More tests => 4; use ExporterTest qw( foo bar ); diff --git a/t/01-function-wipeout.t b/t/01-function-wipeout.t index be2430b..b5d3967 100644 --- a/t/01-function-wipeout.t +++ b/t/01-function-wipeout.t @@ -1,9 +1,7 @@ -#!/usr/bin/env perl use warnings; use strict; -use FindBin; -use lib "$FindBin::Bin/lib"; +use lib 't/lib'; use Test::More tests => 9; use_ok('FunctionWipeout'); diff --git a/t/02-inheritance.t b/t/02-inheritance.t index 0d7e101..4e1ff27 100644 --- a/t/02-inheritance.t +++ b/t/02-inheritance.t @@ -1,9 +1,7 @@ -#!/usr/bin/env perl use warnings; use strict; -use FindBin; -use lib "$FindBin::Bin/lib"; +use lib 't/lib'; use Test::More tests => 10; use_ok('Inheritance'); diff --git a/t/03-unimport.t b/t/03-unimport.t index 126bc10..647e587 100644 --- a/t/03-unimport.t +++ b/t/03-unimport.t @@ -1,9 +1,7 @@ -#!/usr/bin/env perl use warnings; use strict; -use FindBin; -use lib "$FindBin::Bin/lib"; +use lib 't/lib'; use Test::More tests => 6; use_ok('Unimport'); diff --git a/t/04-except.t b/t/04-except.t index 5c8b6ea..8d57594 100644 --- a/t/04-except.t +++ b/t/04-except.t @@ -1,9 +1,7 @@ -#!/usr/bin/env perl use warnings; use strict; -use FindBin; -use lib "$FindBin::Bin/lib"; +use lib 't/lib'; use Test::More tests => 6; { package ExceptWithArray; diff --git a/t/05-explicit-cleanee.t b/t/05-explicit-cleanee.t index 74e93eb..e74b1a7 100644 --- a/t/05-explicit-cleanee.t +++ b/t/05-explicit-cleanee.t @@ -1,9 +1,7 @@ -#!/usr/bin/env perl use warnings; use strict; -use FindBin; -use lib "$FindBin::Bin/lib"; +use lib 't/lib'; use Test::More tests => 2019; use_ok('CleaneeTarget'); diff --git a/t/05-syntax-error.t b/t/05-syntax-error.t index ee7178b..485c578 100644 --- a/t/05-syntax-error.t +++ b/t/05-syntax-error.t @@ -1,9 +1,7 @@ -#!/usr/bin/env perl use warnings; use strict; -use FindBin; -use lib "$FindBin::Bin/lib"; +use lib 't/lib'; use Test::More tests => 1; eval { require "SyntaxError.pm" }; diff --git a/t/06-other-types.t b/t/06-other-types.t index f6254ec..155a386 100644 --- a/t/06-other-types.t +++ b/t/06-other-types.t @@ -1,9 +1,7 @@ -#!/usr/bin/env perl use warnings; use strict; -use FindBin; -use lib "$FindBin::Bin/lib"; +use lib 't/lib'; use Test::More tests => 17; our $pvio; diff --git a/t/10-pure-perl.t b/t/10-pure-perl.t index e624c0c..2426afb 100644 --- a/t/10-pure-perl.t +++ b/t/10-pure-perl.t @@ -39,21 +39,21 @@ ok( ; use Config; -use FindBin qw($Bin); use IPC::Open2 qw(open2); use File::Glob 'bsd_glob'; # for the $^X-es $ENV{PERL5LIB} = join ($Config{path_sep}, @INC); +$ENV{PATH} = ''; # rerun the tests under the assumption of pure-perl my $this_file = quotemeta(__FILE__); -for my $fn (bsd_glob("$Bin/*.t")) { +for my $fn ( bsd_glob("t/*.t") ) { next if $fn =~ /${this_file}$/; - my @cmd = ($^X, $fn); + my @cmd = map { $_ =~ /(.+)/ } ($^X, $fn); # this is cheating, and may even hang here and there (testing on windows passed fine) # if it does - will have to fix it somehow (really *REALLY* don't want to pull