podcheck.t: Output fixed problems as passing to-do tests
authorFather Chrysostomos <sprout@cpan.org>
Sat, 8 Jun 2013 21:07:38 +0000 (14:07 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Sun, 9 Jun 2013 06:25:13 +0000 (23:25 -0700)
t/porting/podcheck.t

index a22672b..4b4c893 100644 (file)
@@ -1704,6 +1704,7 @@ foreach my $filename (@files) {
 
         skip($skip, 1) if $skip;
         my @diagnostics;
+        my @thankful_diagnostics;
         my $indent = '  ';
 
         my $total_known = 0;
@@ -1736,6 +1737,7 @@ foreach my $filename (@files) {
                 $files_with_unknown_issues{$filename} = 1;
             } elsif ($problem_count < $known_problems{$canonical}{$message}) {
                $diagnostic = output_thanks($filename, $known_problems{$canonical}{$message}, $problem_count, $message);
+               push @thankful_diagnostics, $diagnostic;
             }
             push @diagnostics, $diagnostic if $diagnostic;
         }
@@ -1749,12 +1751,18 @@ foreach my $filename (@files) {
             next if $known_problems{$canonical}{$message} < 0; # Preserve negs
             my $diagnostic = output_thanks($filename, $known_problems{$canonical}{$message}, 0, $message);
             push @diagnostics, $diagnostic if $diagnostic;
+            push @thankful_diagnostics, $diagnostic if $diagnostic;
         }
 
         my $output = "POD of $filename";
         $output .= ", excluding $total_known not shown known potential problems"
                                                                 if $total_known;
-        ok(@diagnostics == 0, $output);
+        if (@diagnostics && @diagnostics == @thankful_diagnostics) {
+            # Output fixed issues as passing to-do tests, so they do not
+            # cause failures, but t/harness still flags them.
+            $output .= " # TODO"
+        }
+        ok(@diagnostics == @thankful_diagnostics, $output);
         if (@diagnostics) {
             note(join "", @diagnostics,
             "See end of this test output for your options on silencing this");