Skip to content

Commit

Permalink
Use latest logic for testing for author tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelhorne committed Apr 4, 2021
1 parent 67075ad commit c4b3906
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 15 deletions.
1 change: 1 addition & 0 deletions MANIFEST
Expand Up @@ -17,6 +17,7 @@ t/noopentickets.t
t/pod-cm.t
t/pod.t
t/prereq.t
t/snippets.t
t/spelling.t
t/unused.t
t/vars.t
3 changes: 3 additions & 0 deletions Makefile.PL
Expand Up @@ -13,6 +13,9 @@ WriteMakefile(
: ()),
PL_FILES => {},
TEST_REQUIRES => {
'Data::Dumper' => 0,
'English' => 0,
'File::Spec' => 0 ,
'Test::CleanNamespaces' => 0,
'Test::Carp' => 0,
'Test::Deep' => 0,
Expand Down
12 changes: 6 additions & 6 deletions t/prereq.t
Expand Up @@ -4,10 +4,10 @@ use strict;

use Test::Most;

unless($ENV{RELEASE_TESTING}) {
plan( skip_all => 'Author tests not required for installation' );
if($ENV{AUTHOR_TESTING}) {
eval 'use Test::Prereq';
plan(skip_all => 'Test::Prereq required to test dependencies') if $@;
prereq_ok();
} else {
plan(skip_all => 'Author tests not required for installation');
}

eval 'use Test::Prereq';
plan skip_all => 'Test::Prereq required to test dependencies' if $@;
prereq_ok();
24 changes: 24 additions & 0 deletions t/snippets.t
@@ -0,0 +1,24 @@
#!perl -wT

use strict;
use warnings;
use File::Spec;
use Test::Most;

if($ENV{AUTHOR_TESTING}) {
eval 'use Test::Pod::Snippets';

if($@) {
plan(skip_all => 'Test::Pod::Snippets required for testing POD code snippets');
} else {
my $tps = Test::Pod::Snippets->new();

my @modules = qw/ DateTime::Format::Genealogy /;

$tps->runtest(module => $_, testgroup => 1) for @modules;

done_testing();
}
} else {
plan(skip_all => 'Author tests not required for installation');
}
18 changes: 9 additions & 9 deletions t/spelling.t
Expand Up @@ -5,16 +5,16 @@ use warnings;

use Test::Most;

unless($ENV{RELEASE_TESTING}) {
plan(skip_all => 'Author tests not required for installation');
}

eval 'use Test::Spelling';
if($@) {
plan(skip_all => 'Test::Spelling required for testing POD spelling');
if($ENV{AUTHOR_TESTING}) {
eval 'use Test::Spelling';
if($@) {
plan(skip_all => 'Test::Spelling required for testing POD spelling');
} else {
add_stopwords(<DATA>);
all_pod_files_spelling_ok();
}
} else {
add_stopwords(<DATA>);
all_pod_files_spelling_ok();
plan(skip_all => 'Author tests not required for installation');
}

__END__
Expand Down

0 comments on commit c4b3906

Please sign in to comment.