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() ); |
13fb11fd |
12 | |
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. The value for each is a hash, which contains one or more |
17 | # (although currently more than one makes no sense) of the following |
18 | # things:- |
19 | # skip => a true value means this module is not checked |
20 | # ignore => array ref containing list of methods which |
21 | # do not need to be documented. |
22 | my $exceptions = { |
23 | 'SQL::Abstract' => { |
24 | ignore => [ |
25 | qw/belch |
26 | puke/ |
27 | ] |
28 | }, |
29 | 'SQL::Abstract::Test' => { skip => 1 }, |
72935ffc |
30 | 'DBIx::Class::Storage::Debug::PrettyPrint' => { skip => 1 }, |
13fb11fd |
31 | }; |
32 | |
33 | foreach my $module (@modules) { |
34 | SKIP: |
35 | { |
36 | skip "$module - No user visible methods", |
37 | 1 |
38 | if ( $exceptions->{$module}{skip} ); |
39 | |
40 | # build parms up from ignore list |
41 | my $parms = {}; |
42 | $parms->{trustme} = |
43 | [ map { qr/^$_$/ } @{ $exceptions->{$module}{ignore} } ] |
44 | if exists( $exceptions->{$module}{ignore} ); |
45 | |
46 | # run the test with the potentially modified parm set |
47 | pod_coverage_ok( $module, $parms, "$module POD coverage" ); |
48 | } |
49 | } |
10e6c946 |
50 | |
51 | done_testing; |