astroboy has asked for the wisdom of the Perl Monks concerning the following question:

I can't see anything in the docs, but is here any way to skip certain sub directories when running Test::Pod::Coverage? The reason I ask is that I have machine generated packages (from DBIx:Class:Schema::Loader) that don't require documentation. I'm only interested in ensuring that custom packages written by human hands get checked.....
  • Comment on Skipping packages in Pod::Coverage tests

Replies are listed 'Best First'.
Re: Skipping packages in Pod::Coverage tests
by Anonymous Monk on Jun 19, 2009 at 04:23 UTC
    Isn't this what you need?
    use Test::More; eval "use Test::Pod::Coverage"; plan skip_all => "Test::Pod::Coverage required for testing pod coverag +e" if $@; my @modules = grep{!/^Exclude::ME::General$/} all_modules(); plan tests => scalar @modules; pod_coverage_ok($_) for @modules;
      thanks!
        Here's update, based on Module::New
        use strict; use warnings; use Test::More; eval "use Test::Pod::Coverage 1.04"; plan skip_all => 'Test::Pod::Coverage 1.04 required' if $@; plan skip_all => 'set TEST_POD to enable this test' unless $ENV{TEST_P +OD};
        The idea is that only module developers would be interested in pod/coverage tests
Re: Skipping packages in Pod::Coverage tests
by Khen1950fx (Canon) on Jun 19, 2009 at 05:20 UTC
    I would probably try a skip block:

    #!/usr/bin/perl use strict; use warnings; use Test::More tests => 2; BEGIN { use_ok( 'Test::Pod::Coverage' ); } SKIP: { eval { require some::module }; skip "no pod available", 1 if $@; my $module = new some::module; isa_ok( $module, 'some::module' ); $module->test_some( "modules" ); is( $module->errors, 0, "No errors in modules" ); }
      Why? A skip block wouldn't change Test::Pod::Coverage behaviour.