File: 91podcoverage.t

package info (click to toggle)
libsql-abstract-perl 2.000001-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 744 kB
  • sloc: perl: 3,443; makefile: 8
file content (51 lines) | stat: -rw-r--r-- 1,584 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
use warnings;
use strict;

use Test::More;

use Pod::Coverage 0.19;
use Test::Pod::Coverage 1.04;

my @modules = sort { $a cmp $b } ( Test::Pod::Coverage::all_modules() );

# Since this is about checking documentation, a little documentation
# of what this is doing might be in order...
# The exceptions structure below is a hash keyed by the module
# name.  The value for each is a hash, which contains one or more
# (although currently more than one makes no sense) of the following
# things:-
#   skip   => a true value means this module is not checked
#   ignore => array ref containing list of methods which
#             do not need to be documented.
my $exceptions = {
    'SQL::Abstract' => { ignore => [qw(
      belch
      puke
      DETECT_AUTOGENERATED_STRINGIFICATION
    )]},
    'SQL::Abstract::Tree' => { ignore => [qw(BUILDARGS)] },
    'SQL::Abstract::Test' => { skip => 1 },
    'SQL::Abstract::Formatter' => { skip => 1 },
    'SQL::Abstract::Parts' => { skip => 1 },
    'DBIx::Class::Storage::Debug::PrettyPrint' => { skip => 1 },
};

foreach my $module (@modules) {
  SKIP:
    {
        skip "$module - No user visible methods",
          1
          if ( $exceptions->{$module}{skip} );

        # build parms up from ignore list
        my $parms = {};
        $parms->{trustme} =
          [ map { qr/^$_$/ } @{ $exceptions->{$module}{ignore} } ]
          if exists( $exceptions->{$module}{ignore} );

        # run the test with the potentially modified parm set
        pod_coverage_ok( $module, $parms, "$module POD coverage" );
    }
}

done_testing;