Skip Menu |

This queue is for tickets about the Module-Build CPAN distribution.

Report information
The Basics
Id: 4256
Status: resolved
Priority: 0/
Queue: Module-Build

People
Owner: Nobody in particular
Requestors: MARKSTOS [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 0.21
Fixed in: (no value)



Subject: [PATCH] testpod action for testing POD
Hello, I'm interested in having a built-in function to test the distributions POD. Right now, a number of module authors are distributing a generic script in each distribution that does that. Have one copy of this functionality in Module::Build makes more sense to me. Attached is a patch that accomplishes this. I have a couple of concerns with it: - I couldn't get it to work with just "Test" instead of "Test::More". I don't understand why, since "plan" is the only function I used. It appears that Module::Build has carefully avoided Test::More thus far, so it would be great if someone could make this work with just "Test". - I'm not sure if the name is the best. I think one of the most critical times to test POD is before making a distribution. For that reason, perhaps this makes sense as a function in "testdist", which would be intended for module authors to use more-so than module installers. Here's the URL to the patch: http://mark.stosberg.com/Tech/perl/module-build-testpod.patch I was 'inspired' by code from Andy Lester's WWW::Mechanize distribution.
Hi Mark, I'm finally getting to this patch. I simplified it a little, here's the form I'm applying it in. Thanks. sub ACTION_testpod { my $self = shift; $self->depends_on('docs'); eval q{use Test::Pod 0.95; 1} or die "The 'testpod' action requires Test::Pod version 0.95"; my @files = sort keys %{$self->_find_pods($self->libdoc_dirs)}, keys %{$self->_find_pods($self->bindoc_dirs)} or die "Couldn't find any POD files to test\n"; { package Module::Build::PodTester; # Don't want to pollute the main namespace Test::Pod->import( tests => scalar @files ); pod_file_ok($_) foreach @files; } }