Commit | Line | Data |
13fb11fd |
1 | use Test::More; |
2 | |
3 | eval "use Pod::Coverage 0.19"; |
4 | plan skip_all => 'Pod::Coverage 0.19 required' if $@; |
5 | eval "use Test::Pod::Coverage 1.04"; |
6 | plan skip_all => 'Test::Pod::Coverage 1.04 required' if $@; |
7 | |
8 | plan skip_all => 'set TEST_POD to enable this test' |
9 | unless ( $ENV{TEST_POD} || -e 'MANIFEST.SKIP' ); |
10 | |
11 | my @modules = sort { $a cmp $b } ( Test::Pod::Coverage::all_modules() ); |
12 | plan tests => scalar(@modules); |
13 | |
14 | # Since this is about checking documentation, a little documentation |
15 | # of what this is doing might be in order... |
16 | # The exceptions structure below is a hash keyed by the module |
17 | # name. The value for each is a hash, which contains one or more |
18 | # (although currently more than one makes no sense) of the following |
19 | # things:- |
20 | # skip => a true value means this module is not checked |
21 | # ignore => array ref containing list of methods which |
22 | # do not need to be documented. |
23 | my $exceptions = { |
24 | 'SQL::Abstract' => { |
25 | ignore => [ |
26 | qw/belch |
27 | puke/ |
28 | ] |
29 | }, |
30 | 'SQL::Abstract::Test' => { skip => 1 }, |
6b1bf9f8 |
31 | 'SQL::Abstract::Tree' => { skip => 1 }, |
32 | 'DBIx::Class::Storage::PrettyPrinter' => { skip => 1 }, |
13fb11fd |
33 | }; |
34 | |
35 | foreach my $module (@modules) { |
36 | SKIP: |
37 | { |
38 | skip "$module - No user visible methods", |
39 | 1 |
40 | if ( $exceptions->{$module}{skip} ); |
41 | |
42 | # build parms up from ignore list |
43 | my $parms = {}; |
44 | $parms->{trustme} = |
45 | [ map { qr/^$_$/ } @{ $exceptions->{$module}{ignore} } ] |
46 | if exists( $exceptions->{$module}{ignore} ); |
47 | |
48 | # run the test with the potentially modified parm set |
49 | pod_coverage_ok( $module, $parms, "$module POD coverage" ); |
50 | } |
51 | } |