From dd356c9eebaea9eab73bfbc89dd6f4b910c5b1c4 Mon Sep 17 00:00:00 2001 From: Nigel Horne Date: Wed, 15 May 2024 08:32:12 -0400 Subject: [PATCH] use AUTHOR_TESTING instead of RELEASE_TESTING --- t/gv.t | 16 ++++++++-------- t/kwalitee.t | 18 ++++++++++-------- t/manifest.t | 8 ++++---- t/noplan.t | 15 ++++++++------- t/unused.t | 22 ++++++++++++---------- t/used.t | 4 ++-- 6 files changed, 44 insertions(+), 39 deletions(-) diff --git a/t/gv.t b/t/gv.t index d037b5c..e7ce695 100644 --- a/t/gv.t +++ b/t/gv.t @@ -5,14 +5,14 @@ use warnings; use Test::Most; -if(not $ENV{RELEASE_TESTING}) { - plan(skip_all => 'Author tests not required for installation'); -} - -eval "use Test::GreaterVersion"; +if($ENV{AUTHOR_TESTING}) { + eval 'use Test::GreaterVersion'; -plan skip_all => "Test::GreaterVersion required for checking versions" if $@; + plan(skip_all => 'Test::GreaterVersion required for checking versions') if $@; -Test::GreaterVersion::has_greater_version_than_cpan('Geo::Coder::List'); + Test::GreaterVersion::has_greater_version_than_cpan('Geo::Coder::List'); -done_testing(); + done_testing(); +} else { + plan(skip_all => 'Author tests not required for installation'); +} diff --git a/t/kwalitee.t b/t/kwalitee.t index 882a00b..531bd16 100644 --- a/t/kwalitee.t +++ b/t/kwalitee.t @@ -3,12 +3,14 @@ use warnings; use Test::Most; -unless($ENV{RELEASE_TESTING}) { - plan( skip_all => "Author tests not required for installation" ); -} - -eval { require Test::Kwalitee; Test::Kwalitee->import(); }; +if($ENV{AUTHOR_TESTING}) { + eval "use Test::Kwalitee tests => [ qw( -has_meta_yml ) ]"; -plan( skip_all => 'Test::Kwalitee not installed; skipping' ) if $@; - -unlink 'Debian_CPANTS.txt' if -e 'Debian_CPANTS.txt'; + if($@) { + plan(skip_all => 'Test::Kwalitee not installed; skipping') if $@; + } else { + unlink('Debian_CPANTS.txt') if -e 'Debian_CPANTS.txt'; + } +} else { + plan(skip_all => 'Author tests not required for installation'); +} diff --git a/t/manifest.t b/t/manifest.t index 0268263..eaef239 100644 --- a/t/manifest.t +++ b/t/manifest.t @@ -4,10 +4,10 @@ use strict; use warnings; use Test::Most; -unless ( $ENV{RELEASE_TESTING} ) { - plan( skip_all => "Author tests not required for installation" ); +unless($ENV{AUTHOR_TESTING}) { + plan(skip_all => 'Author tests not required for installation'); } eval "use Test::CheckManifest 0.9"; -plan skip_all => "Test::CheckManifest 0.9 required" if $@; -ok_manifest({ filter => [qr/.git/] }); +plan(skip_all => 'Test::CheckManifest 0.9 required') if $@; +ok_manifest({ filter => [qr/(\.git)|(\..+\.yml$)/] }); diff --git a/t/noplan.t b/t/noplan.t index 3c96b95..0990cdd 100644 --- a/t/noplan.t +++ b/t/noplan.t @@ -5,13 +5,14 @@ use warnings; use Test::Most; -unless($ENV{RELEASE_TESTING}) { - plan( skip_all => "Author tests not required for installation" ); -} +if($ENV{'AUTHOR_TESTING'}) { + eval 'use Test::NoPlan qw / all_plans_ok /'; -eval 'use Test::NoPlan qw / all_plans_ok /'; -if($@) { - plan skip_all => 'Test::NoPlan required for test verification'; + if($@) { + plan(skip_all => 'Test::NoPlan required for test verification'); + } else { + all_plans_ok(); + } } else { - all_plans_ok(); + plan(skip_all => 'Author tests not required for installation'); } diff --git a/t/unused.t b/t/unused.t index 8eb9f1a..9a3ecc3 100644 --- a/t/unused.t +++ b/t/unused.t @@ -4,15 +4,17 @@ use strict; use warnings; use Test::Most; -unless($ENV{RELEASE_TESTING}) { - plan(skip_all => "Author tests not required for installation"); -} - -eval 'use warnings::unused -global'; -if($@ || ($warnings::unused::VERSION < 0.04)) { - plan(skip_all => 'warnings::unused >= 0.04 needed for testing'); +if($ENV{AUTHOR_TESTING}) { + eval { + eval 'use warnings::unused 0.04'; + }; + if($@) { + plan(skip_all => 'warnings::unused needed for test for unused variables'); + } else { + use_ok('Geo::Coder::List'); + new_ok('Geo::Coder::List'); + plan(tests => 2); + } } else { - use_ok('Geo::Coder::List'); - new_ok('Geo::Coder::List'); - plan tests => 2; + plan(skip_all => 'Author tests not required for installation'); } diff --git a/t/used.t b/t/used.t index 1ecaf8d..52ac9da 100644 --- a/t/used.t +++ b/t/used.t @@ -3,8 +3,8 @@ use strict; use Test::Most; -unless($ENV{RELEASE_TESTING}) { - plan(skip_all => "Author tests not required for installation"); +unless($ENV{'AUTHOR_TESTING'}) { + plan(skip_all => 'Author tests not required for installation'); } eval 'use Test::Module::Used';