summaryrefslogtreecommitdiff
path: root/Porting
diff options
context:
space:
mode:
authorColin Kuskie <colink@perldreamer.com>2012-10-02 18:19:14 -0700
committerSteffen Mueller <smueller@cpan.org>2012-10-05 08:27:29 +0200
commitec9012acbc1b007a42276c1d49dd53727b2af596 (patch)
treec59a5f3951880b86b3aceb3746452c1acf61ffb4 /Porting
parent6aa4fbb50135d4863535200030aadfeb8c583c6e (diff)
downloadperl-ec9012acbc1b007a42276c1d49dd53727b2af596.tar.gz
Refactor Porting/Maintainers.pm to use Test::More instead of making TAP by hand.
With a small fix from committer: No use to eval {} module loading.
Diffstat (limited to 'Porting')
-rw-r--r--Porting/Maintainers.pm24
1 files changed, 7 insertions, 17 deletions
diff --git a/Porting/Maintainers.pm b/Porting/Maintainers.pm
index 8f0d05242f..42dec5fabf 100644
--- a/Porting/Maintainers.pm
+++ b/Porting/Maintainers.pm
@@ -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.07;
+$VERSION = 0.08;
require Exporter;
@@ -302,6 +302,8 @@ sub show_results {
}
}
} elsif ($Check or $Checkmani) {
+ require Test::More;
+ Test::More->import;
if( @Files ) {
missing_maintainers(
$Checkmani
@@ -348,21 +350,13 @@ 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";
- }
+ 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 {
@@ -378,16 +372,12 @@ 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";
- }
+ ok($MANIFEST{$f}, "File $f has a maintainer and is in MANIFEST");
}
}
sub finish_tap_output {
- print "1..".$TestCounter."\n";
+ done_testing();
}
1;