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