Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

petdance (2468)

petdance
  andy@petdance.com
http://www.perlbuzz.com/
AOL IM: petdance (Add Buddy, Send Message)
Yahoo! ID: petdance (Add User, Send Message)
Jabber: petdance@gmail.com

I'm Andy Lester, and I like to test stuff. I also write for the Perl Journal, and do tech edits on books. Sometimes I write code, too.

Journal of petdance (2468)

Thursday May 22, 2003
10:39 PM

Free pod checking for your modules

[ #12391 ]
pudge is doin' a bunch of new module releases tonight. I'm posting my standard pod.t file for him to include in his releases.

# $Id$

use Test::More;
use File::Spec;
use File::Find;
use strict;

eval "use Test::Pod 0.95";

if ($@) {
    plan skip_all => "Test::Pod v0.95 required for testing POD";
} else {
    Test::Pod->import;
    my @files;
    my $blib = File::Spec->catfile(qw(blib lib));
    find( sub {push @files, $File::Find::name if /\.p(l|m|od)$/}, $blib);
    plan tests => scalar @files;
    foreach my $file (@files) {
        pod_file_ok($file);
    }
}

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • I had the idea to rewrite my little test script for Pod::Coverage along the same lines now. #/usr/bin/perl -w use strict; use Test::More; use File::Find::Rule; # only for developing, ignore otherwise eval "use Pod::Coverage"; if ($@) { plan skip_all => "Pod::Coverage required for evaluating POD"; } else { Pod::Coverage->import; # find me some modules my @files = File::Find::Rule->file()->name( qr/\.pm$/ )->in('blib/lib'); plan tests => scalar @files; foreach my $
  • My excuse is that it is Friday!!!!! The code I meant to correctly post.....

    #/usr/bin/perl -w
    use strict;

    use Test::More;
    use File::Find::Rule;

    # only for developing, ignore otherwise
    eval "use Pod::Coverage";

    if ($@) {
        plan skip_all => "Pod::Coverage required for evaluating POD";

    } else {
        Pod::Coverage->import;
        # find me some modules
        my @files = File::Find::Rule->file()->name( qr/\.pm$/ )->in('blib/lib');
        plan tests => scalar

    • I'm specifically not using File::Find::Rule because I'm finding that many people don't have it, and a lot of my modules (including all of bdfoy's Mac::* stuff) are pulling in too many dependencies already.

      But I WAS using F:F:R at one point. It's a fine module.

      --

      --
      xoa

      • I tend to only use it while I'm creating modules, then take it out to deploy them. Just a safety precaution on my part to ensure I've written about everything. Afterall it should only be an issue for the developer not the enduser :)
        • Yes, but it's still nice to have the tests out there and have them run on other machines if the user has the ability to do so...
          --

          --
          xoa