7 # Somewhere we chdir and can't load any more modules...
9 if ($^O eq 'MSWin32') {
16 package My::Pod::Checker;
18 use parent 'Pod::Checker';
20 use vars '@errors'; # a bad, bad hack!
28 ++($self->{_NUM_ERRORS})
29 if(!$opts || ($opts->{-severity} && $opts->{-severity} eq 'ERROR'));
30 ++($self->{_NUM_WARNINGS})
31 if(!$opts || ($opts->{-severity} && $opts->{-severity} eq 'WARNING'));
41 my $manifest = 'MANIFEST';
43 open my $m, '<', $manifest or die "Can't open '$manifest': $!";
47 next unless /\s/; # Ignore lines without whitespace (i.e., filename only)
48 my ($file, $separator) = /^(\S+)(\s+)/;
49 next if $file =~ /^cpan\//;
50 next unless ($file =~ /\.(?:pm|pod|pl)$/);
52 @files = sort @files; # so we get consistent results
57 local @My::Pod::Checker::errors;
58 my $checker = My::Pod::Checker->new(-quiet => 1);
59 $checker->parse_from_file($filename, undef);
60 my $error_count = $checker->num_errors();
62 if(! ok($error_count <= 0, "POD of $filename")) {
63 diag( "'$filename' contains POD errors" );
64 diag(sprintf "%s %s: %s at line %s",
65 $_->{-severity}, $_->{-file}, $_->{-msg}, $_->{-line})
66 for @My::Pod::Checker::errors;
70 plan (tests => scalar @files);