3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program. If not, see <https://www.gnu.org/licenses/>.
19 use List
::Util
qw(any);
24 use Test
::Dpkg
qw(:needs);
27 test_needs_module
('Test::Pod::Coverage');
28 test_needs_srcdir_switch
();
32 my @modules_todo = @_;
34 my $scan_perl_modules = sub {
35 my $module = $File::Find
::name
;
37 # Only check modules, scripts are documented in man pages.
38 return unless $module =~ s/\.pm$//;
40 my $mod = Module
::Metadata
->new_from_file($File::Find
::name
);
42 # As a first step just check public modules (version > 0.xx).
43 return if $mod->version() =~ m/^0\.\d\d$/;
45 $module =~ s{^\Q$File::Find::topdir\E/}{};
48 return if any
{ $module eq $_ } @modules_todo;
50 push @modules, $module;
54 wanted
=> $scan_perl_modules,
57 find
(\
%options, Test
::Dpkg
::test_get_perl_dirs
());
62 my @modules_todo = qw(Dpkg::Arch Dpkg::Source::Package);
63 my @modules = all_pod_modules
(@modules_todo);
65 plan tests
=> scalar @modules + scalar @modules_todo;
67 for my $module (@modules) {
68 pod_coverage_ok
($module);
72 local $TODO = 'modules partially documented';
74 for my $module (@modules_todo) {
75 pod_coverage_ok
($module);