X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=xt%2Fstrictures.t;h=adfd9a71f0d60b546c041358a3b04f9c79796865;hb=fe92f179bcbdd9efc0da799b8ca88b7b4f537230;hp=0307cc25993c620fb515472bfa7fe80d4d77d55b;hpb=b2c1212f1e936babcecde9dc8d7562f892f9ef7f;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/xt/strictures.t b/xt/strictures.t index 0307cc2..adfd9a7 100644 --- a/xt/strictures.t +++ b/xt/strictures.t @@ -3,7 +3,7 @@ use strict; use Test::More; use lib 't/lib'; -use DBICTest ':GlobalLock'; +use DBICTest; unless ( DBIx::Class::Optional::Dependencies->req_ok_for ('test_strictures') ) { my $missing = DBIx::Class::Optional::Dependencies->req_missing_for ('test_strictures'); @@ -12,9 +12,18 @@ unless ( DBIx::Class::Optional::Dependencies->req_ok_for ('test_strictures') ) { : plan skip_all => "Test needs: $missing" } - use File::Find; +# The rationale is - if we can load all our optdeps +# that are related to lib/ - then we should be able to run +# perl -c checks (via syntax_ok), and all should just work +my $missing_groupdeps_present = grep + { DBIx::Class::Optional::Dependencies->req_ok_for($_) } + grep + { $_ !~ /^ (?: test | rdbms | dist ) _ /x } + keys %{DBIx::Class::Optional::Dependencies->req_group_list} +; + find({ wanted => sub { -f $_ or return; @@ -31,7 +40,8 @@ find({ Test::Strict::strict_ok($f); Test::Strict::warnings_ok($f); - #Test::Strict::syntax_ok($f) if $f =~ /^ (?: lib )/x; + Test::Strict::syntax_ok($f) + if ! $missing_groupdeps_present and $f =~ /^ (?: lib )/x; }, no_chdir => 1, }, (qw(lib t examples maint)) );