* David Golden <[EMAIL PROTECTED]> [2005-11-14 13:45]:
> How about one that makes pod/pod-coverage skip-all by default
> unless the author explicitly changes the .t files to turn them
> on?

In <http://www.perlmonks.org/index.pl?node_id=508155> I wrote:

> A better approach would be to make their execution depend on
> the action, so someone saying `./Build disttest` would get
> them, whereas someone saying `./Build test` would not.

To which chromatic reacted in
<http://www.perlmonks.org/index.pl?node_id=508160>:

> Great idea! Here's a quick and dirty implementation:
> 
>     package Module::Build::StupidPodTests;
> 
>     use SUPER;
>     use base 'Module::Build';
> 
>     use Module::Build;
> 
>     sub ACTION_disttest
>     {
>         my $self = shift;
>         local $ENV{PERL_TESTPOD} = 1;
>         super();
>     }
> 
>     sub find_test_files
>     {
>         my $self  = shift;
>         my $tests = super();
>         
>         return $tests if $ENV{PERL_TESTPOD};
>         return [ grep { $_ !~ /\bpod.*\.t\z/ } @$tests ];
>     }
> 
>     1;
> 
> Use this in place of Module::Build in your Build.PL file and
> the only suck is that you still have to distribute the
> still-useless-to-everyone-else-but-CPANTS-for-some-reason POD
> testing files.

But at this point, I think even this is not quite the right
approach. Rather, the tests should be built directly into
Module::Build itself à la the `testcover` target. Test::Pod needs
no parametrisation, so it would be trivial to integrate, and it
also is the really valuable test. (At least I can’t think of
*any* case where letting malformed POD through is desirable.)

Test::Pod::Coverage will often need handholding (“yes, I’ve
documented the constructor, even though you can’t tell, silly
thing”), and would thus require some configuration mechanism. Or
it might just be left out, I wouldn’t care. I can only think of
one scenario where it is useful: as a rough guide for
retrospectively adding POD to a complex, un(der)documented suite
of modules.

As far as CPANTS is concerned, awarding points for the respective
issues by checking the metrics themselves is a good idea, but
looking for tests for these metrics seems rather pointless.
Again, checking whether the POD is error-free is arguably
valuable; checking POD coverage is questionable.

Regards,
-- 
#Aristotle
*AUTOLOAD=*_=sub{s/(.*)::(.*)/print$2,(",$\/"," ")[defined wantarray]/e;$1};
&Just->another->Perl->hacker;

Reply via email to