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