8 package My::Pod::Checker;
10 use parent 'Pod::Checker';
12 use vars '@errors'; # a bad, bad hack!
20 ++($self->{_NUM_ERRORS})
21 if(!$opts || ($opts->{-severity} && $opts->{-severity} eq 'ERROR'));
22 ++($self->{_NUM_WARNINGS})
23 if(!$opts || ($opts->{-severity} && $opts->{-severity} eq 'WARNING'));
33 my $manifest = 'MANIFEST';
35 open my $m, '<', $manifest or die "Can't open '$manifest': $!";
39 next unless /\s/; # Ignore lines without whitespace (i.e., filename only)
40 my ($file, $separator) = /^(\S+)(\s+)/;
41 next if $file =~ /^cpan\//;
42 next unless ($file =~ /\.(?:pm|pod|pl)$/);
45 @files = sort @files; # so we get consistent results
49 local @My::Pod::Checker::errors;
50 my $checker = My::Pod::Checker->new(-quiet => 1);
51 $checker->parse_from_file($filename, undef);
52 my $error_count = $checker->num_errors();
54 if(! ok($error_count <= 0, "POD of $filename")) {
55 diag( "'$filename' contains POD errors" );
56 diag(sprintf "%s %s: %s at line %s",
57 $_->{-severity}, $_->{-file}, $_->{-msg}, $_->{-line})
58 for @My::Pod::Checker::errors;
62 plan (tests => scalar @files);