4 eval "use Pod::Coverage 0.19";
5 plan skip_all => 'Pod::Coverage 0.19 required' if $@;
6 eval "use Test::Pod::Coverage 1.04";
7 plan skip_all => 'Test::Pod::Coverage 1.04 required' if $@;
9 plan skip_all => 'set TEST_POD to enable this test'
10 unless ($ENV{TEST_POD} || -e 'MANIFEST.SKIP');
13 # Since this is about checking documentation, a little documentation
14 # of what this is doing might be in order.
15 # The exceptions structure below is a hash keyed by the module
16 # name. Any * in a name is treated like a wildcard and will behave
17 # as expected. Modules are matched by longest string first, so
18 # A::B::C will match even if there is A::B*
20 # The value for each is a hash, which contains one or more
21 # (although currently more than one makes no sense) of the following
23 # skip => a true value means this module is not checked
24 # ignore => array ref containing list of methods which
25 # do not need to be documented.
29 MODIFY_CODE_ATTRIBUTES
35 'DBIx::Class::Row' => {
40 'DBIx::Class::ResultSource' => {
42 compare_relationship_keys
49 'DBIx::Class::ResultSourceHandle' => {
55 'DBIx::Class::Storage' => {
61 'DBIx::Class::Schema' => {
63 setup_connection_class
67 'DBIx::Class::Schema::Versioned' => {
73 'DBIx::Class::ClassResolver::PassThrough' => { skip => 1 },
74 'DBIx::Class::Componentised' => { skip => 1 },
75 'DBIx::Class::Relationship::*' => { skip => 1 },
76 'DBIx::Class::ResultSetProxy' => { skip => 1 },
77 'DBIx::Class::ResultSourceProxy' => { skip => 1 },
78 'DBIx::Class::Storage::Statistics' => { skip => 1 },
80 # test some specific components whose parents are exempt below
81 'DBIx::Class::Storage::DBI::Replicated*' => {},
82 'DBIx::Class::Relationship::Base' => {},
85 'DBIx::Class::SQLAHacks*' => { skip => 1 },
86 'DBIx::Class::Storage::DBI*' => { skip => 1 },
87 'SQL::Translator::*' => { skip => 1 },
89 # deprecated / backcompat stuff
90 'DBIx::Class::CDBICompat*' => { skip => 1 },
91 'DBIx::Class::ResultSetManager' => { skip => 1 },
92 'DBIx::Class::DB' => { skip => 1 },
94 # skipped because the synopsis covers it clearly
95 'DBIx::Class::InflateColumn::File' => { skip => 1 },
99 for my $string (keys %$exceptions) {
100 my $ex = $exceptions->{$string};
101 $string =~ s/\*/'.*?'/ge;
102 my $re = qr/^$string$/;
103 $ex_lookup->{$re} = $ex;
106 my @modules = sort { $a cmp $b } (Test::Pod::Coverage::all_modules());
108 foreach my $module (@modules) {
111 my ($match) = List::Util::first
113 (sort { length $b <=> length $a || $b cmp $a } (keys %$ex_lookup) )
116 my $ex = $ex_lookup->{$match} if $match;
118 skip ("$module exempt", 1) if ($ex->{skip});
120 # build parms up from ignore list
123 [ map { qr/^$_$/ } @{ $ex->{ignore} } ]
124 if exists($ex->{ignore});
126 # run the test with the potentially modified parm set
127 pod_coverage_ok($module, $parms, "$module POD coverage");