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/>.
20 use Dpkg::Util qw(any);
23 use Test::Dpkg qw(:needs);
26 test_needs_module('Test::Pod::Coverage');
27 test_needs_srcdir_switch();
31 my @modules_todo = @_;
33 my $scan_perl_modules = sub {
34 my $module = $File::Find::name;
36 # Only chack modules, scripts are documented in man pages.
37 return unless $module =~ s/\.pm$//;
39 # As a first step just check public modules (version > 0.xx).
40 return unless system('grep', '-q', '^our \$VERSION = \'[^0]\.',
41 $File::Find::name) == 0;
43 $module =~ s{^\Q$File::Find::topdir\E/}{};
46 return if any { $module eq $_ } @modules_todo;
48 push @modules, $module;
52 wanted => $scan_perl_modules,
55 find(\%options, Test::Dpkg::test_get_perl_dirs());
60 my @modules_todo = qw(Dpkg::Arch Dpkg::Source::Package);
61 my @modules = all_pod_modules(@modules_todo);
63 plan tests => scalar @modules + scalar @modules_todo;
65 for my $module (@modules) {
66 pod_coverage_ok($module);
70 local $TODO = 'modules partially documented';
72 for my $module (@modules_todo) {
73 pod_coverage_ok($module);