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 Test
::Dpkg
qw(:needs);
23 test_needs_srcdir_switch
();
25 my @files = Test
::Dpkg
::all_perl_modules
();
27 plan tests
=> scalar @files;
33 my $mod = Module
::Metadata
->new_from_file($file, collect_pod
=> 1);
34 my $modver = $mod->version();
38 if ($mod->contains_pod()) {
41 foreach my $sect ($mod->pod_inside) {
42 if ($sect eq 'CHANGES') {
47 if ($in_changes and $sect =~ m/^Version ([0-9x.]+)/) {
53 if (not $in_changes) {
54 fail
("module $file does not contain a CHANGES POD section");
58 skip
("module $file does not contain POD", 1);
61 if (defined $podver and $podver eq '0.xx') {
62 ok
($modver =~ m/^0.\d\d$/,
63 "module $file version $modver is POD version 0.xx");
65 ok
($modver eq $podver,
66 "module $file version $modver == POD version $podver");
71 foreach my $file (@files) {
72 module_version_ok
($file);