Bug 39319: Improve pod_checker.t
It was not failing when warnings were found Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
parent
15a030bc76
commit
58bd633d8e
|
|
@ -10,8 +10,20 @@ push @files, qx{git ls-files '*.pl' '*.PL' '*.pm' '*.t'};
|
|||
push @files, qx{git ls-files svc opac/svc}; # Files without extension
|
||||
chomp for @files;
|
||||
|
||||
plan tests => 1;
|
||||
plan tests => scalar @files + 1;
|
||||
|
||||
for my $file (@files) {
|
||||
podchecker($file);
|
||||
my $checker = Pod::Checker->new();
|
||||
$checker->parse_from_file( $file, \*STDERR );
|
||||
my $num_errors = $checker->num_errors;
|
||||
my $num_warnings = $checker->num_warnings;
|
||||
if ( $checker->num_errors > 0 ) {
|
||||
fail("Found pod errors for $file");
|
||||
} elsif ( $checker->num_errors == -1 ) {
|
||||
pass("Skip pod checker for $file - no pod found");
|
||||
} elsif ( $checker->num_warnings ) {
|
||||
fail("Found pod warnings for $file");
|
||||
} else {
|
||||
pass("pod for $file");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue