On Thu, Apr 08, 2010 at 10:48:51AM +0200, Jochen Stenzel wrote:
> Hello,
> 
> for regression tests I wonder if it is possible to use Devel::Cover
> to check coverage for modified lines *only*.
> 
> Checking the entire code every time after a change causes a
> slowdown that is difficult to handle in our projects. More, the
> required information needs to be extracted out of the complete
> analysis result. But knowing about test coverage of the lines in
> question would be a great help.
> 
> This would allow to instrument the code as required, running the
> full test suite, running cover and get informed if the changed code
> ran completely.

This information is available to Devel::Cover (it's stored in the
coverage database) and there is an API to get at it, but nothing that
quite does what you want at the moment.  The data is there for just such
a purpose, so feel free to attack the problem should you feel so
inclined.

> So, is there a way to switch coverage on and off at runtime, let's
> say like profiling with Devel::NYTProf can be switched on and of
> via DB::enable_profile() and DB::disable_profile() and can be
> controled by the setting of the option start=no? (See
> http://search.cpan.org/dist/Devel-NYTProf/lib/Devel/NYTProf.pm#RUN-TIME_CONTROL_OF_PROFILING)

This is a slightly different question.  Se Devel::Cover::set_coverage().
You can turn off all the coverage criteria to get this effect.

-- 
Paul Johnson - p...@pjcj.net
http://www.pjcj.net

Reply via email to