mariamr / Jacoco-Comparison-Tool

11 stars 11 forks source link

Usage of Jacoco-comparison-tool #1

Open Anirudha-Chavan opened 9 years ago

Anirudha-Chavan commented 9 years ago

Hi, I have followed your instructions to find difference between two jacoco reports. First thing is I am not pretty clear from the instructions like where should be bin folder created and what content should be put in bin and source folder. Can you please give example for usage.

I had run this utility and got below exception:

java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:297) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.NullPointerException at edu.cmu.jacoco.HTMLWriter.renderTestSuitCoverage(HTMLWriter.java:137) at edu.cmu.jacoco.HTMLWriter.renderTotalCoverage(HTMLWriter.java:64) at edu.cmu.jacoco.CoverageDiff.renderBranchCoverage(CoverageDiff.java:227) at edu.cmu.jacoco.CoverageDiff.main(CoverageDiff.java:120) ... 6 more

Steps followed:

  1. Created classes folder inside source folder in which all compiled classes are present, but classes are present inside package structure. Like- a.class is present as 1/2/3/a.class. note- classes folder is created because it was showing error- classes folder is not present, which was not defined in instructions. Source folder Path- /opt/code-coverage/codeCoverage/extract/ Error received: Caused by: java.io.FileNotFoundException: /opt/code-coverage/codeCoverage/extract/classes (No such file or directory)
  2. Given source path, 2 execs path, report path
  3. Kept same classes in bin folder.
  4. Run report.sh

Can you please take a look into this issue and post an example.

mariamr commented 9 years ago

Sorry for the late reply Anirudha. Your source folder should be the root folder for the exec files plus a bin folder which includes the compiled source. All your compiled classes or jar file should live under that bin folder. There shouldn't be a no need to create a classes directory. I have updated the README instructions with more details.