From 0e1d5ff27e40173cfad61d125bdcbdc14ebdc169 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 18 Mar 2025 13:41:52 +0100 Subject: [PATCH] Bug 39319: Improve pod_checker.t It was not failing when warnings were found Signed-off-by: Martin Renvoize --- xt/author/pod_checker.t | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) mode change 100644 => 100755 xt/author/pod_checker.t diff --git a/xt/author/pod_checker.t b/xt/author/pod_checker.t old mode 100644 new mode 100755 index 4c7415bb002..b0396640832 --- a/xt/author/pod_checker.t +++ b/xt/author/pod_checker.t @@ -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"); + } } -- 2.49.0