9 # Somewhere we chdir and can't load any more modules...
11 if ($^O eq 'MSWin32') {
20 package My::Pod::Checker;
22 use parent 'Pod::Checker';
24 use vars '@errors'; # a bad, bad hack!
32 ++($self->{_NUM_ERRORS})
33 if(!$opts || ($opts->{-severity} && $opts->{-severity} eq 'ERROR'));
34 ++($self->{_NUM_WARNINGS})
35 if(!$opts || ($opts->{-severity} && $opts->{-severity} eq 'WARNING'));
45 my $manifest = 'MANIFEST';
47 open my $m, '<', $manifest or die "Can't open '$manifest': $!";
51 next unless /\s/; # Ignore lines without whitespace (i.e., filename only)
52 my ($file, $separator) = /^(\S+)(\s+)/;
53 next if $file =~ /^cpan\//;
54 next unless ($file =~ /\.(?:pm|pod|pl)$/);
56 @files = sort @files; # so we get consistent results
61 local @My::Pod::Checker::errors;
62 my $checker = My::Pod::Checker->new(-quiet => 1);
63 $checker->parse_from_file($filename, undef);
64 my $error_count = $checker->num_errors();
66 if(! ok $error_count <= 0, "POD of $filename") {
67 diag( "'$filename' contains POD errors" );
68 diag sprintf "%s %s: %s at line %s",
69 $_->{-severity}, $_->{-file}, $_->{-msg}, $_->{-line}
70 for @My::Pod::Checker::errors;
74 plan tests => scalar @files;