Devel :: Cover - 仅限子程序覆盖

时间:2011-10-24 06:09:21

标签: perl devel-cover

我只想在perl文件中覆盖子程序。 所以在主文件中我插入了以下语句:

mainfile.pl

use Devel::Cover::Subroutine;

如果我运行mainfile.pl,则显示错误:

Devel::Cover: Writing coverage database to /home/devel1/Devel-Cover-0.78/examples1/cover_db/runs/1319109459.10082.56199
Can't find digest for mainfile.pl at /opt/perl_32/lib/site_perl/5.8.8/IA64.ARCHREV_0-thread-multi/Devel/Cover/DB/Structure.pm line 282.
Devel::Cover: Can't find digest for mainfile.pl
--------------------------------------------------------------- ------ ------
File                                                               sub  total
--------------------------------------------------------------- ------ ------
Total                                                              n/a    n/a
--------------------------------------------------------------- ------ ------

如何解决此错误? 但是,当我只使用use Devel::Cover;时,它可以正常工作。

1 个答案:

答案 0 :(得分:6)

Devel::Cover::Subroutine是Devel :: Cover用来表示子程序覆盖率数据的内部模块。你不应该直接使用它。相反,您应该将Devel::Cover-subs_only选项一起使用。