Exclude objects generation processo from JaCoCo coverage measure

3 views
Skip to first unread message

Agustín Nolasco

unread,
Feb 25, 2026, 3:13:21 PMFeb 25
to JaCoCo and EclEmma Users
Hello,

I want to know if exist someway to stop JaCoCo to measure the objects generation process in parameterized property-based tests. For example, I have this code:

@Property()
public void test(@ForAll("lists") List<Integer> list) {
    list.add(3);
}

I want to measure the coverage of method add of List, but the lists generated but the "lists" generator use add in its definition in order to produce serveral lists. The calls to add used in the generator are measured too. There is someway to stop the measure process of JaCoCo and make it start at the beginning of the test? And stop it again at the end of the test.

Kind regards,

Agustin. 

Marc Hoffmann

unread,
Feb 26, 2026, 7:46:53 AMFeb 26
to jac...@googlegroups.com
Hi Agustin,

there is no way to "stop” execution data recording as the probes are directly added with instrumentation.

However, we can reset all execution data programmatically with the runtime API: https://www.jacoco.org/jacoco/trunk/doc/api/org/jacoco/agent/rt/IAgent.html

So you can basically reset the execution data after the setup.

Regards,
-marc

--
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 visit https://groups.google.com/d/msgid/jacoco/4579b59c-c4fa-4ee6-b1aa-0f4d6c30893cn%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages