Including open files in Devel :: Cover reports

I have a project setup as follows:

bin/fizzbuzz-game.pl
lib/FizzBuzz.pm
test/TestFizzBuzz.pm
test/TestFizzBuzz.t

When I start coverage using

perl -MDevel::Cover=-db,/tmp/cover_db test/*.t

... I get the following output:

----------------------------------- ------ ------ ------ ------ ------ ------
File                                  stmt   bran   cond    sub   time  total
----------------------------------- ------ ------ ------ ------ ------ ------
lib/FizzBuzz.pm                      100.0  100.0    n/a  100.0    1.4  100.0
test/TestFizzBuzz.pm                 100.0    n/a    n/a  100.0   97.9  100.0
test/TestFizzBuzz.t                  100.0    n/a    n/a  100.0    0.7  100.0
Total                                100.0  100.0    n/a  100.0  100.0  100.0
----------------------------------- ------ ------ ------ ------ ------ ------

That is: the fully detected bin / fizzbuzz-game.pl file is not included in the results.

How to fix it?

+3
source share
2 answers

Have you checked the documentation? The section Choosing the most suitable files seems to be most useful. :) It seems that the option +selectis the one you are looking for.

+2
source

I thought about that.

, (fizzbuzz-game.pl) , . , . ( , , , " main()" ).

, . bin/fizzbuzz-game.pl lib/FizzBuzzGame.pm, .

:

----------------------------------- ------ ------ ------ ------ ------ ------
File                                  stmt   bran   cond    sub   time  total
----------------------------------- ------ ------ ------ ------ ------ ------
lib/FizzBuzz.pm                      100.0  100.0    n/a  100.0    0.0  100.0
lib/FizzBuzzGame.pm                   75.0    n/a    n/a   75.0  100.0   75.0
Total                                 87.5  100.0    n/a   83.3  100.0   88.9
----------------------------------- ------ ------ ------ ------ ------ ------
+1

Source: https://habr.com/ru/post/1747085/


All Articles