What are some code coverage tools for Perl?

后端 未结 4 1115
谎友^
谎友^ 2020-12-29 06:48

Are there any good (and preferably free) code coverage tools out there for Perl?

4条回答
  •  一整个雨季
    2020-12-29 07:10

    Moritz discusses how modules built with Module::Build can use Devel::Cover easily.

    For modules using ExtUtils::MakeMaker, an extension module exists to invoke the same functionality. Adding the following code before the call to WriteMakefile():

    eval "use ExtUtils::MakeMaker::Coverage";
    if( !$@ ) {
        print "Adding testcover target\n";
    }
    

    ... will allow one to run the command 'make testcover' and have Devel::Cover perform its magic.

提交回复
热议问题