How can I use 'prove' and Devel::Cover together? I tried:
perl -MDevel::Cover prove ...
but didn't cover the scripts that ran.
Mark
}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
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
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
I was surprised there wasn't a more general "-M" switch, but maybe there
is a technical for research for that.
Mark
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