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:
Jonathan Druart 2025-03-18 13:41:52 +01:00 committed by Katrin Fischer
parent 15a030bc76
commit 58bd633d8e
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
1 changed files with 14 additions and 2 deletions

16
xt/author/pod_checker.t Normal file → Executable file
View File

@ -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");
}
}