Fix exception on complex update/delete under a replicated setup
[dbsrgits/DBIx-Class.git] / xt / strictures.t
CommitLineData
4a233f30 1use warnings;
2use strict;
3
4use Test::More;
5use lib 't/lib';
dfaed1c7 6use DBICTest;
4a233f30 7
8unless ( DBIx::Class::Optional::Dependencies->req_ok_for ('test_strictures') ) {
9 my $missing = DBIx::Class::Optional::Dependencies->req_missing_for ('test_strictures');
10 $ENV{RELEASE_TESTING}
11 ? die ("Failed to load release-testing module requirements: $missing")
12 : plan skip_all => "Test needs: $missing"
13}
14
4a233f30 15use File::Find;
16
18637ebb 17# The rationale is - if we can load all our optdeps
18# that are related to lib/ - then we should be able to run
19# perl -c checks (via syntax_ok), and all should just work
20my $missing_groupdeps_present = grep
21 { DBIx::Class::Optional::Dependencies->req_ok_for($_) }
22 grep
23 { $_ !~ /^ (?: test | rdbms | dist ) _ /x }
24 keys %{DBIx::Class::Optional::Dependencies->req_group_list}
25;
26
4a233f30 27find({
28 wanted => sub {
29 -f $_ or return;
30 m/\.(?: pm | pl | t )$ /ix or return;
31
32 return if m{^(?:
33 maint/Makefile.PL.inc/.+ # all the maint inc snippets are auto-strictured
34 |
4a233f30 35 t/lib/DBICTest/Util/OverrideRequire.pm # no stictures by design (load order sensitive)
36 )$}x;
37
38 my $f = $_;
39
40 Test::Strict::strict_ok($f);
41 Test::Strict::warnings_ok($f);
42
18637ebb 43 Test::Strict::syntax_ok($f)
44 if ! $missing_groupdeps_present and $f =~ /^ (?: lib )/x;
4a233f30 45 },
46 no_chdir => 1,
47}, (qw(lib t examples maint)) );
48
49done_testing;