r2086 - in
packages/libtest-pod-coverage-perl/branches/upstream/current: . t
Niko Tyni
ntyni-guest at costa.debian.org
Thu Feb 2 21:33:49 UTC 2006
Author: ntyni-guest
Date: 2006-02-02 21:33:49 +0000 (Thu, 02 Feb 2006)
New Revision: 2086
Added:
packages/libtest-pod-coverage-perl/branches/upstream/current/t/PC_Inherited.pm
packages/libtest-pod-coverage-perl/branches/upstream/current/t/PC_Inherits.pm
packages/libtest-pod-coverage-perl/branches/upstream/current/t/alt_class.t
Modified:
packages/libtest-pod-coverage-perl/branches/upstream/current/Changes
packages/libtest-pod-coverage-perl/branches/upstream/current/Coverage.pm
packages/libtest-pod-coverage-perl/branches/upstream/current/MANIFEST
packages/libtest-pod-coverage-perl/branches/upstream/current/META.yml
Log:
Load /tmp/tmp.UhbD24/libtest-pod-coverage-perl-1.08 into
packages/libtest-pod-coverage-perl/branches/upstream/current.
Modified: packages/libtest-pod-coverage-perl/branches/upstream/current/Changes
===================================================================
--- packages/libtest-pod-coverage-perl/branches/upstream/current/Changes 2006-02-02 21:14:48 UTC (rev 2085)
+++ packages/libtest-pod-coverage-perl/branches/upstream/current/Changes 2006-02-02 21:33:49 UTC (rev 2086)
@@ -1,12 +1,24 @@
Revision history for Test::Pod::Coverage
-1.06 Tue Jun 22 16:51:42 CDT 2004
- [ENHANCEMENTS]
- * Looks in blib/ if there is one, otherwise looks in lib/
- * Doesn't report "no public symbols" unless verbose mode is on.
- * Thanks to David Wheeler and Shawn Sorichetti for nudging.
- This behavior will be in Test::Pod soon, too.
+1.08 Wed Jan 25 21:59:49 CST 2006
+ [FIXES]
+ * File and directory names may now contain periods and hyphens.
+ * Now exports all_modules().
+1.07_01 Wed Dec 28 23:10:31 CST 2005
+ [ENHANCEMENTS]
+ * Can now use an alternate class that implements the Pod::Coverage
+ interface. This is mostly useful for avoiding the necessity to
+ redocument or itemize overriden methods in a subclass by using
+ Pod::Coverage::CountParents. Thanks to Ricardo Signes.
+
+1.06 Tue Jun 22 16:51:42 CDT 2004
+ [ENHANCEMENTS]
+ * Looks in blib/ if there is one, otherwise looks in lib/
+ * Doesn't report "no public symbols" unless verbose mode is on.
+ * Thanks to David Wheeler and Shawn Sorichetti for nudging.
+ This behavior will be in Test::Pod soon, too.
+
1.04 Sat May 1 00:06:14 CDT 2004
[FIXES]
* Now it runs taint-safe. I was not untainting the filename.
Modified: packages/libtest-pod-coverage-perl/branches/upstream/current/Coverage.pm
===================================================================
--- packages/libtest-pod-coverage-perl/branches/upstream/current/Coverage.pm 2006-02-02 21:14:48 UTC (rev 2085)
+++ packages/libtest-pod-coverage-perl/branches/upstream/current/Coverage.pm 2006-02-02 21:33:49 UTC (rev 2086)
@@ -6,13 +6,11 @@
=head1 VERSION
-Version 1.06
+Version 1.08
- $Header: /home/cvs/test-pod-coverage/Coverage.pm,v 1.26 2004/06/22 22:02:06 andy Exp $
-
=cut
-our $VERSION = "1.06";
+our $VERSION = "1.08";
=head1 SYNOPSIS
@@ -43,6 +41,16 @@
pod_coverage_ok( "Mail::SRS::Reversable", $trustme );
pod_coverage_ok( "Mail::SRS::Shortcut", $trustme );
+Alternately, you could use L<Pod::Coverage::CountParents>, which always allows
+a subclass to reimplement its parents' methods without redocumenting them. For
+example:
+
+ my $trustparents = { coverage_class => 'Pod::Coverage::CountParents' };
+ pod_coverage_ok( "IO::Handle::Frayed", $trustparents );
+
+(The C<coverage_class> parameter is not passed to the coverage class with other
+parameters.)
+
If you want POD coverage for your module, but don't want to make
Test::Pod::Coverage a prerequisite for installing, create the following
as your F<t/pod-coverage.t> file:
@@ -79,6 +87,7 @@
no strict 'refs';
*{$caller.'::pod_coverage_ok'} = \&pod_coverage_ok;
*{$caller.'::all_pod_coverage_ok'} = \&all_pod_coverage_ok;
+ *{$caller.'::all_modules'} = \&all_modules;
$Test->exported_to($caller);
$Test->plan(@_);
@@ -86,6 +95,8 @@
=head1 FUNCTIONS
+All functions listed below are exported to the calling namespace.
+
=head2 all_pod_coverage_ok( [$parms, ] $msg )
Checks that the POD code in all modules in the distro have proper POD
@@ -95,6 +106,9 @@
C<Pod::Coverage> object that the function uses. Check the
L<Pod::Coverage> manual for what those can be.
+The exception is the C<coverage_class> parameter, which specifies a class to
+use for coverage testing. It defaults to C<Pod::Coverage>.
+
=cut
sub all_pod_coverage_ok {
@@ -112,7 +126,8 @@
my $thisok = pod_coverage_ok( $module, $parms, $thismsg );
$ok = 0 unless $thisok;
}
- } else {
+ }
+ else {
$Test->plan( tests => 1 );
$Test->ok( 1, "No modules found." );
}
@@ -129,14 +144,21 @@
C<Pod::Coverage> object that the function uses. Check the
L<Pod::Coverage> manual for what those can be.
+The exception is the C<coverage_class> parameter, which specifies a class to
+use for coverage testing. It defaults to C<Pod::Coverage>.
+
=cut
sub pod_coverage_ok {
my $module = shift;
- my $parms = (@_ && (ref $_[0] eq "HASH")) ? shift : {};
+ my %parms = (@_ && (ref $_[0] eq "HASH")) ? %{(shift)} : ();
my $msg = @_ ? shift : "Pod coverage on $module";
- my $pc = Pod::Coverage->new( package => $module, %$parms );
+ my $pc_class = (delete $parms{coverage_class}) || 'Pod::Coverage';
+ eval "require $pc_class" or die $@;
+
+ my $pc = $pc_class->new( package => $module, %parms );
+
my $rating = $pc->coverage;
my $ok;
if ( defined $rating ) {
@@ -150,7 +172,8 @@
$module, $rating*100, scalar @nakies ) );
$Test->diag( "\t$_" ) for @nakies;
}
- } else { # No symbols
+ }
+ else { # No symbols
my $why = $pc->why_unrated;
my $nopublics = ( $why =~ "no public symbols defined" );
my $verbose = $ENV{HARNESS_VERBOSE} || 0;
@@ -165,7 +188,8 @@
=head2 all_modules( [@dirs] )
Returns a list of all modules in I<$dir> and in directories below. If
-no directories are passed, it defaults to "blib".
+no directories are passed, it defaults to F<blib> if F<blib> exists,
+or F<lib> if not.
Note that the modules are as "Foo::Bar", not "Foo/Bar.pm".
@@ -204,9 +228,12 @@
# Untaint the parts
for ( @parts ) {
- /^([a-zA-Z0-9_]+)$/;
- die qq{Invalid and untaintable filename "$file"!} unless $_ eq $1;
- $_ = $1;
+ if ( /^([a-zA-Z0-9_\.\-]+)$/ && ($_ eq $1) ) {
+ $_ = $1; # Untaint the original
+ }
+ else {
+ die qq{Invalid and untaintable filename "$file"!};
+ }
}
my $module = join( "::", @parts );
push( @modules, $module );
@@ -221,14 +248,55 @@
return 'lib';
}
+=head1 BUGS
+
+Please report any bugs or feature requests to
+C<bug-test-pod-coverage at rt.cpan.org>, or through the web interface at
+L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test-Pod-Coverage>.
+I will be notified, and then you'll automatically be notified of progress on
+your bug as I make changes.
+
+=head1 SUPPORT
+
+You can find documentation for this module with the perldoc command.
+
+ perldoc Test::Pod::Coverage
+
+You can also look for information at:
+
+=over 4
+
+=item * AnnoCPAN: Annotated CPAN documentation
+
+L<http://annocpan.org/dist/Test-Pod-Coverage>
+
+=item * CPAN Ratings
+
+L<http://cpanratings.perl.org/d/Test-Pod-Coverage>
+
+=item * RT: CPAN's request tracker
+
+L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Test-Pod-Coverage>
+
+=item * Search CPAN
+
+L<http://search.cpan.org/dist/Test-Pod-Coverage>
+
+=back
+
=head1 AUTHOR
-Written by Andy Lester, C<< <andy at petdance.com> >>.
+Written by Andy Lester, C<< <andy at petdance.com> >>.
-=head1 COPYRIGHT
+=head1 ACKNOWLEDGEMENTS
-Copyright 2004, Andy Lester, All Rights Reserved.
+Thanks to Ricardo Signes for patches, and Richard Clamp for
+writing Pod::Coverage.
+=head1 COPYRIGHT & LICENSE
+
+Copyright 2006, Andy Lester, All Rights Reserved.
+
You may use, modify, and distribute this package under the
same terms as Perl itself.
Modified: packages/libtest-pod-coverage-perl/branches/upstream/current/MANIFEST
===================================================================
--- packages/libtest-pod-coverage-perl/branches/upstream/current/MANIFEST 2006-02-02 21:14:48 UTC (rev 2085)
+++ packages/libtest-pod-coverage-perl/branches/upstream/current/MANIFEST 2006-02-02 21:33:49 UTC (rev 2086)
@@ -5,6 +5,9 @@
Makefile.PL
t/00.load.t
t/all_pod_coverage_ok.t
+t/alt_class.t
+t/PC_Inherited.pm
+t/PC_Inherits.pm
t/Nopod.pm
t/Nosymbols.pm
t/Privates.pm
Modified: packages/libtest-pod-coverage-perl/branches/upstream/current/META.yml
===================================================================
--- packages/libtest-pod-coverage-perl/branches/upstream/current/META.yml 2006-02-02 21:14:48 UTC (rev 2085)
+++ packages/libtest-pod-coverage-perl/branches/upstream/current/META.yml 2006-02-02 21:33:49 UTC (rev 2086)
@@ -1,7 +1,7 @@
# http://module-build.sourceforge.net/META-spec.html
#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
name: Test-Pod-Coverage
-version: 1.06
+version: 1.08
version_from: Coverage.pm
installdirs: site
requires:
@@ -10,4 +10,4 @@
Test::More: 0
distribution_type: module
-generated_by: ExtUtils::MakeMaker version 6.21
+generated_by: ExtUtils::MakeMaker version 6.30
Added: packages/libtest-pod-coverage-perl/branches/upstream/current/t/PC_Inherited.pm
===================================================================
--- packages/libtest-pod-coverage-perl/branches/upstream/current/t/PC_Inherited.pm 2006-02-02 21:14:48 UTC (rev 2085)
+++ packages/libtest-pod-coverage-perl/branches/upstream/current/t/PC_Inherited.pm 2006-02-02 21:33:49 UTC (rev 2086)
@@ -0,0 +1,15 @@
+package PC_Inherited;
+
+=head1 NAME
+
+PC_Inherited - we write docs so you don't have to!
+
+=head2 C< new >
+
+ ...
+
+=cut
+
+sub new { }
+
+1;
Added: packages/libtest-pod-coverage-perl/branches/upstream/current/t/PC_Inherits.pm
===================================================================
--- packages/libtest-pod-coverage-perl/branches/upstream/current/t/PC_Inherits.pm 2006-02-02 21:14:48 UTC (rev 2085)
+++ packages/libtest-pod-coverage-perl/branches/upstream/current/t/PC_Inherits.pm 2006-02-02 21:33:49 UTC (rev 2086)
@@ -0,0 +1,13 @@
+package PC_Inherits;
+use base qw(PC_Inherited);
+
+=head1 NAME
+
+PC_Inherit - inherits and doesn't document parent things!
+
+=cut
+
+# documented in parent; stupid to document here, too!
+sub new { }
+
+1;
Added: packages/libtest-pod-coverage-perl/branches/upstream/current/t/alt_class.t
===================================================================
--- packages/libtest-pod-coverage-perl/branches/upstream/current/t/alt_class.t 2006-02-02 21:14:48 UTC (rev 2085)
+++ packages/libtest-pod-coverage-perl/branches/upstream/current/t/alt_class.t 2006-02-02 21:33:49 UTC (rev 2086)
@@ -0,0 +1,21 @@
+#!perl -T
+
+use strict;
+use lib "t";
+use Test::More tests=>2;
+use Test::Builder::Tester;
+
+BEGIN { use_ok( 'Test::Pod::Coverage' ); }
+
+# the follow test checks that PC_Inherits.pm is fully covered, which it is not
+# -- unless you count the documentation of its parent, PC_Inherited; we do this
+# with the Pod::Coverage::CountParents subclass of Pod::Coverage -- so, if this
+# test passes, it means the subclass was, in fact, used
+test_out( "ok 1 - Checking PC_Inherits" );
+pod_coverage_ok(
+ "PC_Inherits",
+ { coverage_class => 'Pod::Coverage::CountParents' },
+ "Checking PC_Inherits",
+);
+
+test_test( "allows alternate Pod::Coverage class" );
More information about the Pkg-perl-cvs-commits
mailing list