how to use jacoco.exec report

前端 未结 10 1365
感情败类
感情败类 2020-12-07 18:30

I generated a code coverage report from jacoco, which is jacoco.exec. But I don\'t know how to use it ...

The way I generated it is through command line:

10条回答
  •  孤城傲影
    2020-12-07 19:15

    This answer would be similar to @Evans Y. One can generate HTML files (over here in report directory) and XML file (named as cov) with the help of below command from Jacoco documentation.

    java -jar lib/jacococli.jar report jacoco.exec \
    --classfiles C:\Users\severalOtherDirectories\YourProject\target\classes \
    --html ./report --xml cov.xml
    

    HTML Report: This report would be able to show total number of lines covered/uncovered at the Class or method level, but won't be able to show what actual line(s) are covered/uncovered in the same.

    XML file: After plugging this generated file in the project and simply using VS code coverage extension (I prefer coverage gutters) , one can visualize line-by-line status in the editor itself.

提交回复
热议问题