On Sun, Nov 14, 2004 at 12:42:14PM -0800, Jim Keenan wrote:

> Installing and using Devel::Cover on Win32 for the
> first time today, I noticed several things and would
> like to know if my experience is anomalous.
> 
> 1.  Since I don't have a C-compiler, I first went to
> ActiveState's PPM Repository, but Devel::Cover's
> latest version (0.50) is listed as a FAIL on Windows. 

I understand that the reason for this is that ActiveState build the
modules in a sort of sandbox where perl is installed in a location other
than where it will be when the module is tested.  During the
installation process, Devel::Cover makes a note of where the core
modules are (@INC) so that they are by default not selected for coverage
analysis.

But during the test process the standard perl, or at least a different
one is used, and thus coverage data is collected for the core modules
that are used.  This causes the tests (correctly) to fail.

> kobesearch.cpan.org directed me to
> http://crazyinsomniac.perlmonk.org/perl/ppm/5.8/, from
> which I was able to download and install a tarball of
> Devel::Cover v0.47.  Following crazy's instructions, I
> was able to install it successfully.

You can also try 0.50 at http://cpan.alternation.net/ppm/Devel-Cover.ppd
Contact [EMAIL PROTECTED] if you have any problems with that release.

> 2.  The Devel::Cover docs describe this as the way to
> run coverage on an uninstalled module:
> 
>     HARNESS_PERL_SWITCHES=-MDevel::Cover make test
>     cover
> 
> I found that, on Windows, I had to switch the syntax
> around to get it to work with nmake
> 
>     nmake test HARNESS_PERL_SWITCHES=-MDevel::Cover
>     cover
> 
> Is that other people's experience?

I've written the syntax for for a Bourne shell or similar, so I'm not
surprised it's different for Windows.  It'll be different for Cshell
too.  Basically, do whatever you need to to set an environment variable.

> 3.  The module whose coverage I was examining was
> ExtUtils::ModuleMaker.  I had used Devel::Cover on
> this module on Darwin, so I knew what to expect for
> results.  But when I ran 'cover' on Windows, it ran
> coverage (and created coverage report .html files) not
> just on the '.pm' files contained within EU::MM, but
> also on *31* .pm files contained under my 'Perl/lib'
> directory.

[ snip list of modules ]

> My hunch is that these are modules and pragmas called
> by Devel::Cover.  Correct?

Or by EU::MM, or by the tests.

> But why do I get these in the printout from
> Devel::Cover on Windows but not on Darwin?

Normally they would not be covered by default, being core modules.  Is
it possible that your perl is in a different location from that with
which the ppm was created?

When Devel::Cover runs it will tell you which directories are being
ignored by default.  See the documentation to alter this if it is wrong
for you.  (Or manually hack Devel::Cover::Inc, but that's not a
supported solution.)

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

Reply via email to