X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=xt%2Fstrictures.t;h=adfd9a71f0d60b546c041358a3b04f9c79796865;hb=c8dc7d3337cdd47a721739473b61c8d4477d9129;hp=45cc88d55aaaa1e7f98d0534cf3f4a487c5726ce;hpb=5292b35adf732e6c40c8b68a291d4b1d3a6446a2;p=dbsrgits%2FDBIx-Class.git diff --git a/xt/strictures.t b/xt/strictures.t index 45cc88d..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; @@ -23,8 +32,6 @@ find({ return if m{^(?: maint/Makefile.PL.inc/.+ # all the maint inc snippets are auto-strictured | - lib/DBIx/Class/Storage/BlockRunner.pm # Moo undetected - | t/lib/DBICTest/Util/OverrideRequire.pm # no stictures by design (load order sensitive) )$}x; @@ -33,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)) );