X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=xt%2Fstrictures.t;h=adfd9a71f0d60b546c041358a3b04f9c79796865;hb=8d54fafa1ac137ce9b59beca9780b8feebce55dd;hp=90738c574a7b9c0807cd36947f30747e8447c2b2;hpb=4f7580b23a647ab1449fcd5a431d0f5d1a920e32;p=dbsrgits%2FDBIx-Class.git diff --git a/xt/strictures.t b/xt/strictures.t index 90738c5..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,15 +32,7 @@ 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) - | - lib/DBIx/Class/Storage/DBI/Replicated/Replicant.pm # Moose::Role no longer detected (RT#83433) - | - lib/DBIx/Class/Storage/DBI/Replicated/WithDSN.pm # Moose::Role no longer detected (RT#83433) - | - lib/DBIx/Class/Storage/DBI/Replicated/Balancer.pm # Moose::Role no longer detected (RT#83433) )$}x; my $f = $_; @@ -39,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)) );