From: Peter Rabbitson Date: Sun, 7 Mar 2010 02:22:07 +0000 (+0000) Subject: Switch NoTab/EOL checks to Opt::Deps X-Git-Tag: v0.08121~76 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d146b340450aaf82f53b6e781606139c51d79f84;p=dbsrgits%2FDBIx-Class.git Switch NoTab/EOL checks to Opt::Deps Enable NoTab checks Disable EOL checks --- diff --git a/lib/DBIx/Class/Optional/Dependencies.pm b/lib/DBIx/Class/Optional/Dependencies.pm index 6e46f91..bc262eb 100644 --- a/lib/DBIx/Class/Optional/Dependencies.pm +++ b/lib/DBIx/Class/Optional/Dependencies.pm @@ -90,13 +90,13 @@ my $reqs = { test_notabs => { req => { - #'Test::NoTabs' => '0.9', + 'Test::NoTabs' => '0.9', }, }, test_eol => { req => { - #'Test::EOL' => '0.6', + 'Test::EOL' => '0.6', }, }, diff --git a/t/06notabs.t b/t/06notabs.t index a06b6cb..8676ff6 100644 --- a/t/06notabs.t +++ b/t/06notabs.t @@ -5,26 +5,20 @@ use Test::More; use lib 't/lib'; use DBICTest; -my @MODULES = ( - 'Test::NoTabs 0.9', -); - -plan skip_all => 'Does not work with done_testing, temp disabled'; - # 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_notabs') ) { + my $missing = DBIx::Class::Optional::Dependencies->req_missing_for ('test_notabs'); + $ENV{RELEASE_TESTING} || DBICTest::AuthorCheck->is_author + ? die ("Failed to load release-testing module requirements: $missing") + : plan skip_all => "Test needs: $missing" } -all_perl_files_ok(qw/t lib script maint/); +Test::NoTabs::all_perl_files_ok(qw/t lib script maint/); -done_testing; +# FIXME - need to fix Test::NoTabs +#done_testing; diff --git a/t/07eol.t b/t/07eol.t index 36a690e..85301ef 100644 --- a/t/07eol.t +++ b/t/07eol.t @@ -5,29 +5,25 @@ use Test::More; use lib 't/lib'; use DBICTest; -my @MODULES = ( - 'Test::EOL 0.6', -); - -plan skip_all => 'Does not work with done_testing, temp disabled'; - # 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" ); - } + +plan skip_all => 'Test::EOL very broken'; + +require DBIx::Class; +unless ( DBIx::Class::Optional::Dependencies->req_ok_for ('test_eol') ) { + my $missing = DBIx::Class::Optional::Dependencies->req_missing_for ('test_eol'); + $ENV{RELEASE_TESTING} || DBICTest::AuthorCheck->is_author + ? die ("Failed to load release-testing module requirements: $missing") + : plan skip_all => "Test needs: $missing" } TODO: { local $TODO = 'Do not fix those yet - we have way too many branches out there, merging will be hell'; - all_perl_files_ok({ trailing_whitespace => 1}, qw/t lib script maint/); + Test::EOL::all_perl_files_ok({ trailing_whitespace => 1}, qw/t lib script maint/); } -done_testing; +# FIXME - need to fix Test::EOL +#done_testing; diff --git a/t/87ordered.t b/t/87ordered.t index 9ca9c2e..63651f6 100644 --- a/t/87ordered.t +++ b/t/87ordered.t @@ -64,36 +64,36 @@ $employee = $employees->search({group_id=>4})->first; $employee->group_id(1); $employee->update; ok( - check_rs($employees->search_rs({group_id=>1})) && check_rs($employees->search_rs({group_id=>4})), - "overloaded update 3" + check_rs($employees->search_rs({group_id=>1})) && check_rs($employees->search_rs({group_id=>4})), + "overloaded update 3" ); $employee = $employees->search({group_id=>4})->first; $employee->update({group_id=>2}); ok( - check_rs($employees->search_rs({group_id=>2})) && check_rs($employees->search_rs({group_id=>4})), - "overloaded update 4" + check_rs($employees->search_rs({group_id=>2})) && check_rs($employees->search_rs({group_id=>4})), + "overloaded update 4" ); $employee = $employees->search({group_id=>4})->first; $employee->group_id(1); $employee->position(3); $employee->update; ok( - check_rs($employees->search_rs({group_id=>1})) && check_rs($employees->search_rs({group_id=>4})), - "overloaded update 5" + check_rs($employees->search_rs({group_id=>1})) && check_rs($employees->search_rs({group_id=>4})), + "overloaded update 5" ); $employee = $employees->search({group_id=>4})->first; $employee->group_id(2); $employee->position(undef); $employee->update; ok( - check_rs($employees->search_rs({group_id=>2})) && check_rs($employees->search_rs({group_id=>4})), - "overloaded update 6" + check_rs($employees->search_rs({group_id=>2})) && check_rs($employees->search_rs({group_id=>4})), + "overloaded update 6" ); $employee = $employees->search({group_id=>4})->first; $employee->update({group_id=>1,position=>undef}); ok( - check_rs($employees->search_rs({group_id=>1})) && check_rs($employees->search_rs({group_id=>4})), - "overloaded update 7" + check_rs($employees->search_rs({group_id=>1})) && check_rs($employees->search_rs({group_id=>4})), + "overloaded update 7" ); # multicol tests begin here @@ -154,7 +154,7 @@ $employees = $employees->search(undef,{order_by=>[qw/group_id_2 group_id_3 posit $employee = $employees->search({group_id_2=>4, group_id_3=>1})->first; $employee->group_id_2(1); $employee->update; -ok( +ok( check_rs($employees->search_rs({group_id_2=>4, group_id_3=>1})) && check_rs($employees->search_rs({group_id_2=>1, group_id_3=>1})), "overloaded multicol update 1"