The question about using Jacoco

22 views
Skip to first unread message

王明珍

unread,
Apr 25, 2021, 11:05:40 PM4/25/21
to JaCoCo and EclEmma Users
1. As the image shown,it is set to append coverage to the exec file. If a certain class or method is deleted from the new code, but the old code still exists in the newly generated code coverage and cannot be counted? What is the solution?
1.jpg
2. Without deleting the recently generated exec file, what operation will cause jacoco to re-count the code coverage?

Mountainminds

unread,
Apr 26, 2021, 2:30:17 AM4/26/21
to jac...@googlegroups.com
Hi,

code coverage reports are created based on class files. Whatever classfiles you provide to the JaCoCo report generator will show up in the report. Typically you will supply all the application‘s class files of your current build.

Exec files are used to determine the coverage status of the class files in the report. Exec files contain the execution status of all classes loaded by the Java VM during execution. If the same class is contained multiple times in a exec file (append) the execution status is merged before the report is generated.

Execution data for class files (or class file versions) which are not part of the report are ignored and not shown in the report.

I hope this answers your questions,
-marc



On 26. Apr 2021, at 05:01, 王明珍 <dbw...@gmail.com> wrote:


1. It is set to append coverage to the exec file. If a certain class or method is deleted from the new code, but the old code still exists in the newly generated code coverage and cannot be counted? What is the solution?
2. Without deleting the recently generated exec file, what operation will cause jacoco to re-count the code coverage?

--
You received this message because you are subscribed to the Google Groups "JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jacoco+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/2b10ecc0-82c2-49d2-a226-e4372afa619bn%40googlegroups.com.

Mountainminds

unread,
Apr 26, 2021, 2:33:07 AM4/26/21
to jac...@googlegroups.com
Hi,

class files at execution time have to be the exact same class files than the class files used when creating the report.

When you delete a method it is a different version of the class file and exec data from previous test runs can not be applied any more.

Regards,
-marc

On 26. Apr 2021, at 05:05, 王明珍 <dbw...@gmail.com> wrote:


1. As the image shown,it is set to append coverage to the exec file. If a certain class or method is deleted from the new code, but the old code still exists in the newly generated code coverage and cannot be counted? What is the solution?
<1.jpg>
2. Without deleting the recently generated exec file, what operation will cause jacoco to re-count the code coverage?

--
You received this message because you are subscribed to the Google Groups "JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jacoco+un...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages