New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor t/Porting/Maintainers.pm to use Test::More instead of making TAP by hand #12457
Comments
From @perlDreamerIn the same vein as the other test/module bridge, |
From @perlDreamer0002-Refactor-Porting-Maintainers.pm-to-use-Test-More-ins.patchFrom 69b235fc51890cfbb958c55677778fed735ba51c Mon Sep 17 00:00:00 2001
From: Colin Kuskie <colink@perldreamer.com>
Date: Tue, 2 Oct 2012 18:19:14 -0700
Subject: [PATCH 2/2] Refactor Porting/Maintainers.pm to use Test::More
instead of making TAP by hand.
---
Porting/Maintainers.pm | 21 +++++----------------
1 files changed, 5 insertions(+), 16 deletions(-)
diff --git a/Porting/Maintainers.pm b/Porting/Maintainers.pm
index 8f0d052..519055c 100644
--- a/Porting/Maintainers.pm
+++ b/Porting/Maintainers.pm
@@ -302,6 +302,7 @@ sub show_results {
}
}
} elsif ($Check or $Checkmani) {
+ eval {use Test::More;};
if( @Files ) {
missing_maintainers(
$Checkmani
@@ -348,21 +349,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 +371,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;
--
1.7.5.4
|
From @tseeThanks, applied as ec9012a. I did a small modification: eval {use Test::More} will still die if Test::More isn't available. Even What you wanted is probably either eval "use Test::More" or simply: require Test::More; which is what I replaced it with. Furthermore, I find it quite ironic that Porting/Maintainers.pm requires |
From [Unknown Contact. See original ticket]Thanks, applied as ec9012a. I did a small modification: eval {use Test::More} will still die if Test::More isn't available. Even What you wanted is probably either eval "use Test::More" or simply: require Test::More; which is what I replaced it with. Furthermore, I find it quite ironic that Porting/Maintainers.pm requires |
@tsee - Status changed from 'new' to 'resolved' |
Migrated from rt.perl.org#115116 (status was 'resolved')
Searchable as RT115116$
The text was updated successfully, but these errors were encountered: