1Test::Pod::Coverage(3)User Contributed Perl DocumentationTest::Pod::Coverage(3)
2
3
4
6 Test::Pod::Coverage - Check for pod coverage in your distribution.
7
9 Version 1.10
10
12 In one of your dist's test files (eg "t/pod-coverage.t"):
13
14 use Test::Pod::Coverage tests=>1;
15 pod_coverage_ok( "Foo::Bar", "Foo::Bar is covered" );
16
18 Test::Pod::Coverage is used to create a test for your distribution, to
19 ensure that all relevant files in your distribution are appropriately
20 documented in pod.
21
22 Can also be called with Pod::Coverage parms.
23
24 use Test::Pod::Coverage tests=>1;
25 pod_coverage_ok(
26 "Foo::Bar",
27 { also_private => [ qr/^[A-Z_]+$/ ], },
28 "Foo::Bar, with all-caps functions as privates",
29 );
30
31 The Pod::Coverage parms are also useful for subclasses that don't re-
32 document the parent class's methods. Here's an example from Mail::SRS.
33
34 pod_coverage_ok( "Mail::SRS" ); # No exceptions
35
36 # Define the three overridden methods.
37 my $trustme = { trustme => [qr/^(new|parse|compile)$/] };
38 pod_coverage_ok( "Mail::SRS::DB", $trustme );
39 pod_coverage_ok( "Mail::SRS::Guarded", $trustme );
40 pod_coverage_ok( "Mail::SRS::Reversable", $trustme );
41 pod_coverage_ok( "Mail::SRS::Shortcut", $trustme );
42
43 Alternately, you could use Pod::Coverage::CountParents, which always
44 allows a subclass to reimplement its parents' methods without
45 redocumenting them. For example:
46
47 my $trustparents = { coverage_class => 'Pod::Coverage::CountParents' };
48 pod_coverage_ok( "IO::Handle::Frayed", $trustparents );
49
50 (The "coverage_class" parameter is not passed to the coverage class
51 with other parameters.)
52
53 If you want POD coverage for your module, but don't want to make
54 Test::Pod::Coverage a prerequisite for installing, create the following
55 as your t/pod-coverage.t file:
56
57 use Test::More;
58 eval "use Test::Pod::Coverage";
59 plan skip_all => "Test::Pod::Coverage required for testing pod coverage" if $@;
60
61 plan tests => 1;
62 pod_coverage_ok( "Pod::Master::Html");
63
64 Finally, Module authors can include the following in a t/pod-coverage.t
65 file and have "Test::Pod::Coverage" automatically find and check all
66 modules in the module distribution:
67
68 use Test::More;
69 eval "use Test::Pod::Coverage 1.00";
70 plan skip_all => "Test::Pod::Coverage 1.00 required for testing POD coverage" if $@;
71 all_pod_coverage_ok();
72
74 All functions listed below are exported to the calling namespace.
75
76 all_pod_coverage_ok( [$parms, ] $msg )
77 Checks that the POD code in all modules in the distro have proper POD
78 coverage.
79
80 If the $parms hashref if passed in, they're passed into the
81 "Pod::Coverage" object that the function uses. Check the Pod::Coverage
82 manual for what those can be.
83
84 The exception is the "coverage_class" parameter, which specifies a
85 class to use for coverage testing. It defaults to "Pod::Coverage".
86
87 pod_coverage_ok( $module, [$parms, ] $msg )
88 Checks that the POD code in $module has proper POD coverage.
89
90 If the $parms hashref if passed in, they're passed into the
91 "Pod::Coverage" object that the function uses. Check the Pod::Coverage
92 manual for what those can be.
93
94 The exception is the "coverage_class" parameter, which specifies a
95 class to use for coverage testing. It defaults to "Pod::Coverage".
96
97 all_modules( [@dirs] )
98 Returns a list of all modules in $dir and in directories below. If no
99 directories are passed, it defaults to blib if blib exists, or lib if
100 not.
101
102 Note that the modules are as "Foo::Bar", not "Foo/Bar.pm".
103
104 The order of the files returned is machine-dependent. If you want them
105 sorted, you'll have to sort them yourself.
106
108 Please report any bugs or feature requests to "bug-test-pod-coverage at
109 rt.cpan.org", or through the web interface at
110 <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test-Pod-Coverage>. I
111 will be notified, and then you'll automatically be notified of progress
112 on your bug as I make changes.
113
115 You can find documentation for this module with the perldoc command.
116
117 perldoc Test::Pod::Coverage
118
119 You can also look for information at:
120
121 · AnnoCPAN: Annotated CPAN documentation
122
123 <http://annocpan.org/dist/Test-Pod-Coverage>
124
125 · CPAN Ratings
126
127 <http://cpanratings.perl.org/d/Test-Pod-Coverage>
128
129 · RT: CPAN's request tracker
130
131 <http://rt.cpan.org/NoAuth/Bugs.html?Dist=Test-Pod-Coverage>
132
133 · Search CPAN
134
135 <http://search.cpan.org/dist/Test-Pod-Coverage>
136
138 <https://github.com/neilbowers/Test-Pod-Coverage>
139
141 Written by Andy Lester, "<andy at petdance.com>".
142
144 Thanks to Ricardo Signes for patches, and Richard Clamp for writing
145 Pod::Coverage.
146
148 Copyright 2006, Andy Lester, All Rights Reserved.
149
150 This program is free software; you can redistribute it and/or modify it
151 under the terms of the Artistic License version 2.0.
152
153 See http://dev.perl.org/licenses/ for more information
154
155
156
157perl v5.32.0 2020-07-28 Test::Pod::Coverage(3)