Commit | Line | Data |
f2a0d52b |
1 | use warnings; |
2 | use strict; |
3 | |
13fb11fd |
4 | use Test::More; |
5 | |
a3dc0922 |
6 | # TEMPORARY |
90e87be1 |
7 | ($ENV{PATH}) = $ENV{PATH} =~ /(.*)/; # screw you here as well -T |
a3dc0922 |
8 | if (my $head = `git rev-parse HEAD`) { |
9 | plan skip_all => "Test disabled until after merge" |
10 | if $head ne `git rev-parse master`; |
11 | |
12 | die "\n\n=================\n!!! Fix the test and remove temporary header !!!\n=================\n\n"; |
13 | } |
14 | |
13fb11fd |
15 | eval "use Pod::Coverage 0.19"; |
16 | plan skip_all => 'Pod::Coverage 0.19 required' if $@; |
17 | eval "use Test::Pod::Coverage 1.04"; |
18 | plan skip_all => 'Test::Pod::Coverage 1.04 required' if $@; |
19 | |
20 | plan skip_all => 'set TEST_POD to enable this test' |
21 | unless ( $ENV{TEST_POD} || -e 'MANIFEST.SKIP' ); |
22 | |
23 | my @modules = sort { $a cmp $b } ( Test::Pod::Coverage::all_modules() ); |
13fb11fd |
24 | |
25 | # Since this is about checking documentation, a little documentation |
26 | # of what this is doing might be in order... |
27 | # The exceptions structure below is a hash keyed by the module |
28 | # name. The value for each is a hash, which contains one or more |
29 | # (although currently more than one makes no sense) of the following |
30 | # things:- |
31 | # skip => a true value means this module is not checked |
32 | # ignore => array ref containing list of methods which |
33 | # do not need to be documented. |
34 | my $exceptions = { |
35 | 'SQL::Abstract' => { |
36 | ignore => [ |
37 | qw/belch |
38 | puke/ |
39 | ] |
40 | }, |
41 | 'SQL::Abstract::Test' => { skip => 1 }, |
72935ffc |
42 | 'DBIx::Class::Storage::Debug::PrettyPrint' => { skip => 1 }, |
13fb11fd |
43 | }; |
44 | |
45 | foreach my $module (@modules) { |
46 | SKIP: |
47 | { |
48 | skip "$module - No user visible methods", |
49 | 1 |
50 | if ( $exceptions->{$module}{skip} ); |
51 | |
52 | # build parms up from ignore list |
53 | my $parms = {}; |
54 | $parms->{trustme} = |
55 | [ map { qr/^$_$/ } @{ $exceptions->{$module}{ignore} } ] |
56 | if exists( $exceptions->{$module}{ignore} ); |
57 | |
58 | # run the test with the potentially modified parm set |
59 | pod_coverage_ok( $module, $parms, "$module POD coverage" ); |
60 | } |
61 | } |
10e6c946 |
62 | |
63 | done_testing; |