[Module-build-general] idea for enhanced POD testing
Status: Beta
Brought to you by:
kwilliams
|
From: Mark S. <ma...@su...> - 2003-09-28 16:23:10
|
Hello, You've probably noticed the new feature on search.cpan.org that now explains POD errors found in Perl modules as part of the documentation display. I think is useful. Something that would complement this would be the ability to easily test all the pod when running "./Build test", rather than noticing the errors after they have been made public. This is already fairly easy by using the below test script. However, there still seems like a better solution should be available than including the same test script in every module distribution. Instead, this seems like a service that it could be reasonable for Module::Build to offer. Perhaps running "./Build testpod" could run this test. Although this wouldn't be run as part of the standard install process I think that's OK. What seems important is that the /developer/ be able to run the test, while it's less important to make this easy for the /user/ to test pod. Mark -- http://mark.stosberg.com/ ##### /usr/src/.cpanplus/5.8.0/build/Data-FormValidator-3.11/t/99_pod.t use Test::More; # Check our Pod # The test was provided by Andy Lester, # who stole it from Brian D. Foy # Thanks to both ! use File::Spec; use File::Find; use strict; eval { require Test::Pod; Test::Pod->import; }; my @files; if ($@) { plan skip_all => "Test::Pod required for testing POD"; } elsif ($Test::Pod::VERSION < 0.95) { plan skip_all => "Test::Pod 0.95 required for testing POD"; } else { my $blib = File::Spec->catfile(qw(blib lib)); find(\&wanted, $blib, 'bin'); plan tests => scalar @files; foreach my $file (@files) { pod_file_ok($file); } } sub wanted { push @files, $File::Find::name if /\.p(l|m|od)$/; } __END__ |