On Fri, Jul 09, 2004 at 12:10:52PM -0500, Pete Krawczyk wrote:

> Consider the following code:
> 
>     $impclass ||= implementor($scheme) ||
>         do {
>             require URI::_foreign;
>             $impclass = 'URI::_foreign';
>         };
> 
> That's in URI.pm, lines 54-58.
> 
> Devel::Cover treats that as a conditional.  So short of deleting
> URI::_foreign, that do BLOCK is never going to return false.
> 
> Devel::Cover will always see that as a partial test, and never a full 
> test:
> http://www.petekrawczyk.com/perl/URI-orig/blib-lib-URI-pm--condition.html#L57
> 
> I don't like that code anyway, since it basically boils down to
>         $impclass = $impclass = 'URI::_foreign';
> assuming $impclass and $scheme aren't set.
> 
> Is that a bug, then?  Or is it something else?  And how should I notate
> that, keeping in mind the goals of Phalanx, so that it's clearly visible
> that no test of that condition's failure can truly take place in a regular
> "make test" run?

There is some initial code in place in Devel::Cover to handle this
situation, but it is not well tested, not documented at all, and has no
(usable) interface.  But you are welcome to play with it anyway ;-)

Should you wish to do so, I would suggest grepping he source for
"uncoverable", and looking at tests/uncoverable.t and
tests/.uncoverable.  Also, google for perl-qa uncoverable to view
previous discussion of this topic.

.uncoverable is a file holding information about which parts of the
module are uncoverable and why.  The format is lines of six columns:

  1.  md5sum of source file
  2.  type of coverage
  3.  line number
  4.  which criterion on that line (0 for first)
  5.  which part of the coverage (based on the internal representation)
  6.  reason

Michael Carman is looking at making this more usable.  Columns one and
five are especially problematic at the moment.  So for the time being
you might prefer to simply note which parts cannot be covered and why,
and later convert that to whatever system we ultimately use.

-- 
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net

Reply via email to