From: Peter Rabbitson Date: Fri, 19 Feb 2010 15:41:36 +0000 (+0000) Subject: Port remaining tests to the Opt::Dep reposiory X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a109c954ad63eb85f81de4afd5444a44fae01575;p=dbsrgits%2FDBIx-Class-Historic.git Port remaining tests to the Opt::Dep reposiory --- diff --git a/lib/DBIx/Class/Optional/Dependencies.pm b/lib/DBIx/Class/Optional/Dependencies.pm index 75c4dc5..b5845d1 100644 --- a/lib/DBIx/Class/Optional/Dependencies.pm +++ b/lib/DBIx/Class/Optional/Dependencies.pm @@ -74,22 +74,41 @@ my $reqs = { }, }, - author => { + + test_pod => { req => { 'Test::Pod' => '1.41', + }, + }, + + test_podcoverage => { + req => { 'Test::Pod::Coverage' => '1.08', 'Pod::Coverage' => '0.20', + }, + }, + + test_notabs => { + req => { #'Test::NoTabs' => '0.9', + }, + }, + + test_eol => { + req => { #'Test::EOL' => '0.6', }, }, - core => { + test_cycle => { req => { - # t/52cycle.t 'Test::Memory::Cycle' => '0', 'Devel::Cycle' => '1.10', + }, + }, + test_dtrelated => { + req => { # t/36datetime.t # t/60core.t 'DateTime::Format::SQLite' => '0', diff --git a/t/02pod.t b/t/02pod.t index 823cf85..1c55c96 100644 --- a/t/02pod.t +++ b/t/02pod.t @@ -5,23 +5,17 @@ use Test::More; use lib qw(t/lib); use DBICTest; -my @MODULES = ( - 'Test::Pod 1.41', -); - # Don't run tests for installs unless ( DBICTest::AuthorCheck->is_author || $ENV{AUTOMATED_TESTING} || $ENV{RELEASE_TESTING} ) { plan( skip_all => "Author tests not required for installation" ); } -# Load the testing modules -foreach my $MODULE ( @MODULES ) { - eval "use $MODULE"; - if ( $@ ) { - $ENV{RELEASE_TESTING} - ? die( "Failed to load required release-testing module $MODULE" ) - : plan( skip_all => "$MODULE not available for testing" ); - } +require DBIx::Class; +unless ( DBIx::Class::Optional::Dependencies->req_ok_for ('test_pod') ) { + my $missing = DBIx::Class::Optional::Dependencies->req_missing_for ('test_pod'); + $ENV{RELEASE_TESTING} || DBICTest::AuthorCheck->is_author + ? die ("Failed to load release-testing module requirements: $missing") + : plan skip_all => "Test needs: $missing" } -all_pod_files_ok(); +Test::Pod::all_pod_files_ok(); diff --git a/t/03podcoverage.t b/t/03podcoverage.t index 88af1c4..d3a5374 100644 --- a/t/03podcoverage.t +++ b/t/03podcoverage.t @@ -6,24 +6,17 @@ use List::Util (); use lib qw(t/lib); use DBICTest; -my @MODULES = ( - 'Test::Pod::Coverage 1.08', - 'Pod::Coverage 0.20', -); - # Don't run tests for installs unless ( DBICTest::AuthorCheck->is_author || $ENV{AUTOMATED_TESTING} || $ENV{RELEASE_TESTING} ) { plan( skip_all => "Author tests not required for installation" ); } -# Load the testing modules -foreach my $MODULE ( @MODULES ) { - eval "use $MODULE"; - if ( $@ ) { - $ENV{RELEASE_TESTING} - ? die( "Failed to load required release-testing module $MODULE" ) - : plan( skip_all => "$MODULE not available for testing" ); - } +require DBIx::Class; +unless ( DBIx::Class::Optional::Dependencies->req_ok_for ('test_podcoverage') ) { + my $missing = DBIx::Class::Optional::Dependencies->req_missing_for ('test_podcoverage'); + $ENV{RELEASE_TESTING} || DBICTest::AuthorCheck->is_author + ? die ("Failed to load release-testing module requirements: $missing") + : plan skip_all => "Test needs: $missing" } # Since this is about checking documentation, a little documentation @@ -148,7 +141,7 @@ foreach my $module (@modules) { if exists($ex->{ignore}); # run the test with the potentially modified parm set - pod_coverage_ok($module, $parms, "$module POD coverage"); + Test::Pod::Coverage::pod_coverage_ok($module, $parms, "$module POD coverage"); } } diff --git a/t/52cycle.t b/t/52cycle.t index 145ad92..dc5f326 100644 --- a/t/52cycle.t +++ b/t/52cycle.t @@ -5,10 +5,9 @@ use Test::More; use lib qw(t/lib); BEGIN { - eval { require Test::Memory::Cycle; require Devel::Cycle }; - if ($@ or Devel::Cycle->VERSION < 1.10) { - plan skip_all => "leak test needs Test::Memory::Cycle and Devel::Cycle >= 1.10"; - }; + require DBIx::Class; + plan skip_all => 'Test needs: ' . DBIx::Class::Optional::Dependencies->req_missing_for ('test_cycle') + unless ( DBIx::Class::Optional::Dependencies->req_ok_for ('test_cycle') ); } use DBICTest;