From: Nicholas Clark Date: Tue, 6 Oct 2009 14:09:00 +0000 (+0200) Subject: Standarise t/porting/*.t on ./test.pl, and remove BEGIN boilerplate. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f7b649f061a3f4f4023e8a7183ec774ef01bab60;p=p5sagit%2Fp5-mst-13.2.git Standarise t/porting/*.t on ./test.pl, and remove BEGIN boilerplate. --- diff --git a/t/porting/args_assert.t b/t/porting/args_assert.t index bf42d0f..95c24f4 100644 --- a/t/porting/args_assert.t +++ b/t/porting/args_assert.t @@ -3,7 +3,9 @@ use strict; use warnings; -use Test::More 'no_plan'; +require './test.pl'; + +plan('no_plan'); # Fail for every PERL_ARGS_ASSERT* macro that was declared but not used. diff --git a/t/porting/diag.t b/t/porting/diag.t index 907c7f9..8b7edb6 100644 --- a/t/porting/diag.t +++ b/t/porting/diag.t @@ -1,7 +1,11 @@ #!/usr/bin/perl use warnings; use strict; -use Test::More 'no_plan'; + +require './test.pl'; + +plan('no_plan'); + $|=1; my $make_exceptions_list = ($ARGV[0]||'') eq '--make-exceptions-list'; @@ -147,7 +151,8 @@ sub check_file { if (exists $entries{$name}) { if ($entries{$name}{todo}) { TODO: { - local $TODO = 'in DATA'; + no warnings 'once'; + local $::TODO = 'in DATA'; fail("Presence of '$name' from $codefn line $."); } } else { diff --git a/t/porting/podcheck.t b/t/porting/podcheck.t index 2567761..4dde790 100644 --- a/t/porting/podcheck.t +++ b/t/porting/podcheck.t @@ -1,8 +1,6 @@ #!/usr/bin/perl -w -BEGIN { - chdir 't' if -d 't'; - @INC = '../lib'; -} + +require './test.pl'; use strict; @@ -14,8 +12,6 @@ BEGIN { require overload; }; -use Test::More; - { package My::Pod::Checker; use strict; @@ -63,15 +59,15 @@ sub pod_ok { $checker->parse_from_file($filename, undef); my $error_count = $checker->num_errors(); - if(! ok $error_count <= 0, "POD of $filename") { + if(! ok($error_count <= 0, "POD of $filename")) { diag( "'$filename' contains POD errors" ); - diag sprintf "%s %s: %s at line %s", - $_->{-severity}, $_->{-file}, $_->{-msg}, $_->{-line} + diag(sprintf "%s %s: %s at line %s", + $_->{-severity}, $_->{-file}, $_->{-msg}, $_->{-line}) for @My::Pod::Checker::errors; }; }; -plan tests => scalar @files; +plan (tests => scalar @files); pod_ok $_ for @files;