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'));
31 s{^\.\./lib$}{lib} for @INC;
34 my $manifest = 'MANIFEST';
36 open my $m, '<', $manifest or die "Can't open '$manifest': $!";
40 next unless /\s/; # Ignore lines without whitespace (i.e., filename only)
41 my ($file, $separator) = /^(\S+)(\s+)/;
42 next if $file =~ /^cpan\//;
43 next unless ($file =~ /\.(?:pm|pod|pl)$/);
44 next if $file eq 'autodoc.pl';
47 @files = sort @files; # so we get consistent results
51 local @My::Pod::Checker::errors;
52 my $checker = My::Pod::Checker->new(-quiet => 1);
53 $checker->parse_from_file($filename, undef);
54 my $error_count = $checker->num_errors();
56 if(! ok($error_count <= 0, "POD of $filename")) {
57 diag( "'$filename' contains POD errors" );
58 diag(sprintf "%s %s: %s at line %s",
59 $_->{-severity}, $_->{-file}, $_->{-msg}, $_->{-line})
60 for @My::Pod::Checker::errors;
64 plan (tests => scalar @files);