File: strictures.t

package info (click to toggle)
libdbix-class-schema-loader-perl 0.07049-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 1,464 kB
  • sloc: perl: 11,469; sh: 544; makefile: 4
file content (41 lines) | stat: -rw-r--r-- 1,085 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
use DBIx::Class::Schema::Loader::Optional::Dependencies
    -skip_all_without => 'test_strictures';

use warnings;
use strict;

use Test::More;
use File::Find;
use lib 't/lib';

# 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::Schema::Loader::Optional::Dependencies->req_ok_for($_) }
  grep
    { $_ !~ /^ (?: test | rdbms | dist ) _ /x }
    keys %{DBIx::Class::Schema::Loader::Optional::Dependencies->req_group_list}
;

find({
  wanted => sub {
    -f $_ or return;
    m/\.(?: pm | pl | t )$ /ix or return;

    return if m{^(?:
      lib/DBIx/Class/Schema/Loader/Optional/Dependencies.pm         # no stictures by design (load speed sensitive)
    )$}x;

    my $f = $_;

    Test::Strict::strict_ok($f);
    Test::Strict::warnings_ok($f);

    Test::Strict::syntax_ok($f)
      if ! $missing_groupdeps_present and $f =~ /^ (?: lib  )/x;
  },
  no_chdir => 1,
}, (qw(lib t script maint)) );

done_testing;