From: Karen Etheridge Date: Fri, 28 Apr 2023 12:00:21 +0000 (+0200) Subject: add warnings tests, for authors only X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a31b59ba2a1cea67238ef8d1babe10a6464c8924;p=p5sagit%2FSub-Name.git add warnings tests, for authors only --- diff --git a/t/RT42725_deparse.t b/t/RT42725_deparse.t index a10ce82..310e796 100644 --- a/t/RT42725_deparse.t +++ b/t/RT42725_deparse.t @@ -2,6 +2,7 @@ use strict; use warnings; use Test::More tests => 2; +use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; use Sub::Name; use B::Deparse; diff --git a/t/RT96893_perlcc.t b/t/RT96893_perlcc.t index 53bb53a..2b16379 100644 --- a/t/RT96893_perlcc.t +++ b/t/RT96893_perlcc.t @@ -2,6 +2,7 @@ use strict; use warnings; use Test::More; +use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; plan skip_all => 'B::C required for testing perlcc -O3' unless eval { +require B::C; }; @@ -14,8 +15,6 @@ plan skip_all => 'Devel::CheckBin required for looking for a perlcc executable' plan skip_all => 'perlcc required' unless Devel::CheckBin::can_run('perlcc'); -plan tests => 1; - my $f = "t/rt96893x.pl"; open my $fh, ">", $f; END { unlink $f if $f } print $fh 'use Sub::Name; subname("main::bar", sub{42}); print "# successfully ran subname() with perlcc\n";'; @@ -27,4 +26,6 @@ local $TODO = 'experimental, for informational purposes only'; is($? >> 8, 0, 'executable completed successfully'); unlink "t/rt96893x", "t/rt96893x.exe"; + +done_testing; # vim: ft=perl diff --git a/t/exotic_names.t b/t/exotic_names.t index 06d6484..a2813af 100644 --- a/t/exotic_names.t +++ b/t/exotic_names.t @@ -2,6 +2,7 @@ use strict; use warnings; use Test::More; +use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; use B 'svref_2object'; BEGIN { $^P |= 0x210 } @@ -81,8 +82,6 @@ push @ordinal, 0x1f4a9, # PILE OF POO unless "$]" < 5.008; -plan tests => @ordinal * 2 * 3; - my $legal_ident_char = "A-Z_a-z0-9'"; $legal_ident_char .= join '', map chr, 0x100, 0x498 unless "$]" < 5.008; @@ -120,3 +119,5 @@ for my $ord (@ordinal) { } caller3_ok $sub, $expected, 'natively compiled sub', $ord; } + +done_testing; diff --git a/t/lexical.t b/t/lexical.t index 15ebfd6..dce40a0 100644 --- a/t/lexical.t +++ b/t/lexical.t @@ -2,6 +2,7 @@ use strict; use warnings; use Test::More; +use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; BEGIN { if ("$]" < 5.018) { plan 'skip_all' => 'lexical subs not supported on this perl'; diff --git a/t/quotes-bug.t b/t/quotes-bug.t index 66c916f..3600bb8 100644 --- a/t/quotes-bug.t +++ b/t/quotes-bug.t @@ -2,6 +2,7 @@ use strict; use warnings; use Test::More tests => 1; +use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; use Sub::Name; my $sub = sub { (caller(0))[3] }; diff --git a/t/smoke.t b/t/smoke.t index d5ab217..0f5022c 100644 --- a/t/smoke.t +++ b/t/smoke.t @@ -3,7 +3,8 @@ use warnings; BEGIN { $^P |= 0x210 } -use Test::More tests => 10; +use Test::More; +use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; use Sub::Name; my $x = subname foo => sub { (caller 0)[3] }; @@ -40,4 +41,5 @@ for ("Blork:: Bar!", "Foo::Bar::Baz") { ::is($DB::sub{$_}, $anon); } +::done_testing(); # vim: ft=perl