如果我在构建testcover流程完成之前将其杀死,是否可以强迫Perl Devel :: Cover生成覆盖率报告? [英] Can I force Perl Devel::Cover to generate a coverage report if I killed the build testcover process before it was finished?
问题描述
如果我能够成功启动Devel :: Cover并开始收集cover_db目录中的数据,那么我可以终止该进程,然后在获取事实之后获取Devel :: Cover或其他实用程序来处理那些二进制文件将Devel :: Cover运行文件和结构文件覆盖到HTML覆盖率报告中?
If I am able to start up Devel::Cover successfully and it starts to collect data in the cover_db directory, can I then kill the process and then after the fact get Devel::Cover or some other utility to process those binary Devel::Cover run files and structure files into the HTML coverage report?
以另一种方式提出问题...除了杀死该进程之外,我是否可以使用Devel :: Cover获取无法停止的进程的覆盖率报告?
To ask the question another way ... Can I use Devel::Cover to get a coverage report for a process that I am unable to stop, other than by killing the process?
此问题与以下内容有关:当Selenium执行时,如何获得Perl CGI脚本的代码覆盖率?
This question is related to: How do I get code coverage of Perl CGI script when executed by Selenium?
推荐答案
我通常的处理方式(例如,在服务器上运行测试)是
The way I usually handle this (say, for running tests on servers) is:
-
为Perl进程生成
__DIE__
处理程序.这样可以确保该过程正常完成,并且Devel :: Cover完成DB填充
Generate a
__DIE__
handler for the Perl process. This ensures that the process completes normally and Devel::Cover finishes the DB population
将SIGINT发送到进程以触发新的DIE处理程序.
Send SIGINT to the process to trigger the new DIE handler.
在cover_db目录中运行 cover
程序这个过程已经死了.
run cover
program on the cover_db directory after the process is dead.
这篇关于如果我在构建testcover流程完成之前将其杀死,是否可以强迫Perl Devel :: Cover生成覆盖率报告?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!