This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Note that five new meta/pod tests are excluded from the Filter distro
[perl5.git] / Porting / Maintainers.pm
index 5f3c4d4..6b28ea7 100644 (file)
@@ -22,7 +22,7 @@ use vars qw(@ISA @EXPORT_OK $VERSION);
                show_results process_options files_to_modules
                finish_tap_output
                reload_manifest);
-$VERSION = 0.06;
+$VERSION = 0.10;
 
 require Exporter;
 
@@ -64,7 +64,7 @@ sub get_module_pat {
     split ' ', $Modules{$m}{FILES};
 }
 
-# exand dir/ or foo* into a full list of files
+# expand dir/ or foo* into a full list of files
 #
 sub expand_glob {
     sort { lc $a cmp lc $b }
@@ -236,7 +236,7 @@ sub files_to_modules {
        if (@ToDo) {
            # Try prefix matching.
 
-           # Need to try longst prefixes first, else lib/CPAN may match
+           # Need to try longest prefixes first, else lib/CPAN may match
            # lib/CPANPLUS/... and similar
 
            my @OrderedModuleByPat
@@ -302,6 +302,8 @@ sub show_results {
            }
        }
     } elsif ($Check or $Checkmani) {
+        require Test::More;
+        Test::More->import;
         if( @Files ) {
                    missing_maintainers(
                        $Checkmani
@@ -347,22 +349,14 @@ sub maintainers_files {
 
 sub duplicated_maintainers {
     maintainers_files();
-    for my $f (keys %files) {
-       if ($files{$f} > 1) {
-           print  "not ok ".++$TestCounter." - File $f appears $files{$f} times in Maintainers.pl\n";
-       } else {
-           print  "ok ".++$TestCounter." - File $f appears $files{$f} times in Maintainers.pl\n";
-       }
+    for my $f (sort keys %files) {
+        cmp_ok($files{$f}, '<=', 1, "File $f appears $files{$f} times in Maintainers.pl");
     }
 }
 
 sub warn_maintainer {
     my $name = shift;
-    if ($files{$name}) {
-       print "ok ".++$TestCounter." - $name has a maintainer\n";
-    } else {
-       print "not ok ".++$TestCounter." - $name has NO maintainer\n";
-    }
+    ok($files{$name}, "$name has a maintainer");
 }
 
 sub missing_maintainers {
@@ -377,17 +371,13 @@ sub missing_maintainers {
 
 sub superfluous_maintainers {
     maintainers_files();
-    for my $f (keys %files) {
-       if ($MANIFEST{$f}) {
-           print "ok ".++$TestCounter." - Maintained file $f appears in MANIFEST\n";
-       } else {
-           print "not ok ".++$TestCounter." - File $f has has a maintainer but is not in MANIFEST\n";
-       }
+    for my $f (sort keys %files) {
+        ok($MANIFEST{$f}, "File $f has a maintainer and is in MANIFEST");
     }
 }
 
 sub finish_tap_output {
-    print "1..".$TestCounter."\n"; 
+    done_testing();
 }
 
 1;