From: Nicholas Clark Date: Tue, 6 Oct 2009 14:26:32 +0000 (+0200) Subject: Standardise t/lib/*.t on ./test.pl, and remove BEGIN boilerplate. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=eaa79d3db7c5e54215151fe5ba663f47927b9c78;p=p5sagit%2Fp5-mst-13.2.git Standardise t/lib/*.t on ./test.pl, and remove BEGIN boilerplate. --- diff --git a/t/lib/cygwin.t b/t/lib/cygwin.t index 8f1410e..497f381 100644 --- a/t/lib/cygwin.t +++ b/t/lib/cygwin.t @@ -7,9 +7,10 @@ BEGIN { print "1..0 # skipped: cygwin specific test\n"; exit 0; } + require './test.pl'; } -use Test::More tests => 16; +plan(tests => 16); is(Cygwin::winpid_to_pid(Cygwin::pid_to_winpid($$)), $$, "perl pid translates to itself"); diff --git a/t/lib/deprecate.t b/t/lib/deprecate.t index 274a7b6..92bb673 100644 --- a/t/lib/deprecate.t +++ b/t/lib/deprecate.t @@ -1,13 +1,13 @@ +#!perl -w use strict; BEGIN { - chdir 't' if -d 't'; - @INC = qw(../lib); + require './test.pl'; } use File::Copy (); use File::Path (); use File::Spec (); -use Test::More tests => 10; +plan(tests => 10); my $test_dir = File::Spec->catdir(qw(lib deprecate)); chdir $test_dir or die "Can't chdir $test_dir"; @@ -31,6 +31,7 @@ our %tests = ( sitearchexp => 0, ); +no warnings 'once'; local %deprecate::Config = (%libdir); my $module = 'Deprecated.pm'; diff --git a/t/lib/mypragma.t b/t/lib/mypragma.t index 0ebd207..0464897 100644 --- a/t/lib/mypragma.t +++ b/t/lib/mypragma.t @@ -1,13 +1,13 @@ #!./perl -BEGIN { - chdir 't'; - @INC = ('../lib', 'lib'); -} - use strict; use warnings; -use Test::More tests => 14; + +BEGIN { + unshift @INC, 'lib'; + require './test.pl'; + plan(tests => 14); +} use mypragma (); # don't enable this pragma yet diff --git a/t/lib/proxy_constant_subs.t b/t/lib/proxy_constant_subs.t index 45b0a54..7c00830 100644 --- a/t/lib/proxy_constant_subs.t +++ b/t/lib/proxy_constant_subs.t @@ -1,7 +1,5 @@ my @symbols; BEGIN { - chdir 't'; - @INC = '../lib'; require Config; if (($Config::Config{'extensions'} !~ /\bB\b/) ){ print "1..0 # Skip -- Perl configured without B module\n"; @@ -14,11 +12,12 @@ BEGIN { # S_IFMT is a real subroutine, and acts as control # SEEK_SET is a proxy constant subroutine. @symbols = qw(S_IFMT SEEK_SET); + require './test.pl'; } use strict; use warnings; -use Test::More tests => 4 * @symbols; +plan(4 * @symbols); use B qw(svref_2object GVf_IMPORTED_CV); use Fcntl @symbols;