Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

prove with Devel::Cover example?

12 views
Skip to first unread message

Mark Stosberg

unread,
Jun 3, 2005, 2:44:53 PM6/3/05
to per...@perl.org
Ok, I'm feeling brain dead about this one-- this seems easy but I'm
missing it.

How can I use 'prove' and Devel::Cover together? I tried:

perl -MDevel::Cover prove ...

but didn't cover the scripts that ran.

Mark

Pete Krawczyk

unread,
Jun 3, 2005, 3:04:50 PM6/3/05
to Mark Stosberg, per...@perl.org
Subject: prove with Devel::Cover example?
From: Mark Stosberg <ma...@summersault.com>
Date: Fri, 3 Jun 2005 18:44:53 +0000 (UTC)

}How can I use 'prove' and Devel::Cover together? I tried:

HARNESS_PERL_SWITCHES=-MDevel::Cover prove file.t

-Pete K
--
Pete Krawczyk
perl at bsod dot net

Steve Peters

unread,
Jun 3, 2005, 3:02:22 PM6/3/05
to Mark Stosberg, per...@perl.org

prove is just a cover over Test::Harness, so (if I remember correctly)

HARNESS_PERL_SWITCHES=-MDevel::Cover prove ...

should work.

Steve Peters
st...@fisharerojo.org

Michael G Schwern

unread,
Jun 4, 2005, 5:10:37 AM6/4/05
to Pete Krawczyk, Mark Stosberg, per...@perl.org
On Fri, Jun 03, 2005 at 02:04:50PM -0500, Pete Krawczyk wrote:
> }How can I use 'prove' and Devel::Cover together? I tried:
>
> HARNESS_PERL_SWITCHES=-MDevel::Cover prove file.t

Kinda surprised there's not a --cover switch.


--
Michael G Schwern sch...@pobox.com http://www.pobox.com/~schwern
ROCKS FALL! EVERYONE DIES!
http://www.somethingpositive.net/sp05032002.shtml

Mark Stosberg

unread,
Jun 4, 2005, 8:00:38 AM6/4/05
to per...@perl.org
On 2005-06-04, Michael G Schwern <sch...@pobox.com> wrote:
> On Fri, Jun 03, 2005 at 02:04:50PM -0500, Pete Krawczyk wrote:
>> }How can I use 'prove' and Devel::Cover together? I tried:
>>
>> HARNESS_PERL_SWITCHES=-MDevel::Cover prove file.t
>
> Kinda surprised there's not a --cover switch.

I was surprised there wasn't a more general "-M" switch, but maybe there
is a technical for research for that.

Mark

--
http://mark.stosberg.com/

Mark Stosberg

unread,
Jul 10, 2005, 6:12:22 PM7/10/05
to per...@perl.org
On Sat, Jun 04, 2005 at 02:10:37AM -0700, Michael G Schwern wrote:
> On Fri, Jun 03, 2005 at 02:04:50PM -0500, Pete Krawczyk wrote:
> > }How can I use 'prove' and Devel::Cover together? I tried:
> >
> > HARNESS_PERL_SWITCHES=-MDevel::Cover prove file.t
>
> Kinda surprised there's not a --cover switch.

I happen to stumble upon merlyn's answer to this in the test suite for
CGI::Prototype.

He created a script called 'cprove' for this purpose, and it looks like
this:

#!/bin/sh
cover -delete
PERL5OPT=-MDevel::Cover=+inc,/Volumes/UFS prove -v -I../lib "$@" &&
cover

Of course, having a hard-coded path to his hard-drive is a drawback,
but's an example of a nice simple solution that gets you out of the business
of remembering so much syntax to type each time.

Mark

--
http://mark.stosberg.com/

0 new messages