[tapx-dev] Broken coverage testing

leif.eriksen at hpa.com.au leif.eriksen at hpa.com.au
Thu Aug 9 01:17:18 BST 2007


I'm pretty much dead in the water with increasing coverage if D::C
doesn't play well with tapx,
Its hard to measure and identify coverage if the tool doesn't work.

I've investigated a little (I don't pretent to understand how D::C
works, it's a mighty piece of
kung fu), but I can see that some objects are not being poulated.

When I run

HARNESS_PERL_SWITCHES=-Mdevel::Cover make test

(or ./Build covertest)

I get a warning about use of an uninitialised var

Use of uninitialized value in sprintf at
/usr/local/lib/perl5/site_perl/5.8.8/i686-linux/Devel/Cover/Report/Html_
minimal.pm line 294, <DATA> line 75.

So I dropped a {use Data::Dumper; print STDERR Dumper(\@_)} at that
point ( its in the function print_summary() ) and I see that a lot of
the objects are empty ...

$VAR1 = [
		...
          bless( {
			...
                   'cover' => bless( {
 
'blib/lib/TAP/Parser/YAMLish/Writer.pm' => bless( {
 
'subroutine' => bless( {
	
... # massive data structure ....

                                      'blib/lib/TAP/Base.pm' => bless(
{}, 'Devel::Cover::DB::File' ),
 
'blib/lib/TAP/Parser/Result/Plan.pm' => bless( {},
'Devel::Cover::DB::File' ),
 
'blib/lib/TAP/Parser/Result/Version.pm' => bless( {},
'Devel::Cover::DB::File' ),
 
'blib/lib/TAP/Parser/Source/Perl.pm' => bless( {},
'Devel::Cover::DB::File' ),
 
'blib/lib/TAP/Parser/Iterator/Process.pm' => bless( {},
'Devel::Cover::DB::File' ),
                                       'blib/lib/TAP/Parser/Source.pm'
=> bless( {}, 'Devel::Cover::DB::File' ),
 
'blib/lib/TAP/Parser/Result/Unknown.pm' => bless( {},
'Devel::Cover::DB::File' ),
                                       'blib/lib/TAP/Parser/Iterator.pm'
=> bless( {}, 'Devel::Cover::DB::File' ),
                                       'blib/lib/TAP/Parser/Result.pm'
=> bless( {}, 'Devel::Cover::DB::File' ),
 
'blib/lib/TAP/Parser/Result/YAML.pm' => bless( {},
'Devel::Cover::DB::File' ),
 
'blib/lib/TAP/Parser/Result/Comment.pm' => bless( {},
'Devel::Cover::DB::File' ),
 
'blib/lib/TAP/Parser/Iterator/Stream.pm' => bless( {},
'Devel::Cover::DB::File' ),
 
'blib/lib/TAP/Parser/Iterator/Array.pm' => bless( {},
'Devel::Cover::DB::File' ),
                                       'lib/TAP/Harness/Color.pm' =>
bless( {
 
'subroutine' => bless( {
 
... # another massive structure...


Now in the summary report from D::C, TAP/Parser/YAMLish/Writer.pm does
have coverage stats , and those with empty objects don't. That is, if
the dump I have of the objects shows a populated object, it has stats in
the summart report, if the object is empty, it has no stats - which is
pretty intuitive really, but doesn't answer the question of 

_why_ do some objects, that get to the print_summary() function, get
there completely empty ? What happened ( or what did TAP::Parser do ) to
the body of those objects ?

----------------------------------- ------ ------ ------ ------ ------
------
File                                  stmt   bran   cond    sub   time
total
----------------------------------- ------ ------ ------ ------ ------
------
blib/lib/TAP/Base.pm                   n/a    n/a    n/a    n/a    n/a
n/a
blib/lib/TAP/Harness.pm                n/a    n/a    n/a    n/a    n/a
n/a
...
...lib/TAP/Parser/YAMLish/Writer.pm   93.5   75.0   50.0   91.7   30.9
85.2
lib/TAP/Harness/Color.pm              48.7   16.7    0.0   77.3    2.8
44.2
Total                                 74.1   53.8   70.4   85.7  100.0
71.4
----------------------------------- ------ ------ ------ ------ ------
------

Now I'm pretty new to T::P, so does anyone closer to it have any idea if
there is some munging in T::P that might be bashing D::C's objects ?

I've posted this here just to add to the info Paul may have to work with
if he gets a chance to address this issue.

L
**********************************************************************
IMPORTANT
The contents of this e-mail and its attachments are confidential and intended
solely for the use of the individual or entity to whom they are addressed.  If
you received this e-mail in error, please notify the HPA Postmaster, postmaster at hpa.com.au,
then delete  the e-mail.
This footnote also confirms that this e-mail message has been swept for the
presence of computer viruses by Ironport. Before opening or using any
attachments, check them for viruses and defects.
Our liability is limited to resupplying any affected attachments.
HPA collects personal information to provide and market our services. For more
information about use, disclosure and access see our Privacy Policy at
www.hpa.com.au
**********************************************************************


More information about the tapx-dev mailing list