how to clear the execution result so far

53 views
Skip to first unread message

lvhu...@gmail.com

unread,
Jul 11, 2019, 9:32:42 PM7/11/19
to JaCoCo and EclEmma Users
Hi,

I was using the jacoco agent in tcpserver mode, and use ant to dump the execution result remotely. It seems that jacoco execution result is cumulative, i.e., result for each test run will be added to the existing result so far. So, how can I clear the current execution result so that I can get the 'clean' or 'ur' execution result of a particular test run?

Thanks.
--huafeng

Evgeny Mandrikov

unread,
Jul 12, 2019, 1:11:51 AM7/12/19
to JaCoCo and EclEmma Users
See documentation of "dump" Ant task at https://www.jacoco.org/jacoco/trunk/doc/ant.html
set "reset" parameter to "true" to reset data on agent side
and
do not append it to same "destfile" or set parameter "append" to "false" to overwrite file.

lvhu...@gmail.com

unread,
Jul 12, 2019, 4:55:16 AM7/12/19
to JaCoCo and EclEmma Users
On Friday, July 12, 2019 at 1:11:51 PM UTC+8, Evgeny Mandrikov wrote:
> See documentation of "dump" Ant task at https://www.jacoco.org/jacoco/trunk/doc/ant.html
> set "reset" parameter to "true" to reset data on agent side
> and
> do not append it to same "destfile" or set parameter "append" to "false" to overwrite file.

Thanks Evgeny!
'reset' will reset data after dumping... so, in order to get the clean execution result, I guess I should dump (to reset), then launch my test, then dump again (to really get the execution result). Is there a better approach?

Thanks.
--huafeng

Evgeny Mandrikov

unread,
Jul 12, 2019, 5:45:29 AM7/12/19
to JaCoCo and EclEmma Users
1. start your application
2. request dump with reset - you'll get execution data of startup
3. do your first test
4. request dump with reset - you'll get execution data of your first test
5. do your second test
6. request dump with reset - you'll get execution data of your second test
7. etc
 
Is there a better approach? 

This does exactly what you asked/wanted to do. So better in what? by which criteria? What does not satisfy you in the above approach?

Huafeng Lu

unread,
Jul 12, 2019, 6:07:39 AM7/12/19
to jac...@googlegroups.com
The approach in my post dumps twice to get the result, so by "better" I meant if we can dump only once.
The approach you stated is essentially the same as mine, so I guess the answer is 'нет' - we already got what we need.
Thanks.
--huafeng

--
You received this message because you are subscribed to a topic in the Google Groups "JaCoCo and EclEmma Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jacoco/tD8zf9v0qv0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jacoco+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/0dfb2254-4363-4f75-8cc0-affc96f666bf%40googlegroups.com.

Marc Hoffmann

unread,
Jul 12, 2019, 9:00:13 AM7/12/19
to jac...@googlegroups.com
For step 2 you can just reset without actually requesting a dump. See documentation of „dump“ task.
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/CALMmMoXvzmbst02NDzWUuGZKas8YS-NTY6GaBU4W_Wf1eX7d7Q%40mail.gmail.com.

lvhu...@gmail.com

unread,
Jul 22, 2019, 8:56:37 AM7/22/19
to JaCoCo and EclEmma Users
Thanks Marc. So it will be something like 
    <jacoco:dump address="192.168.0.156" port="20279" reset="true" dump="false"/>
right?
--huafeng
To unsubscribe from this group and all its topics, send an email to jac...@googlegroups.com.

--
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 jac...@googlegroups.com.

Marc Hoffmann

unread,
Jul 22, 2019, 1:46:24 PM7/22/19
to jac...@googlegroups.com
Exactly!
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/f361d62a-2232-49ac-8fe6-9fe79efb209a%40googlegroups.com.

lvhu...@gmail.com

unread,
Jul 22, 2019, 9:21:30 PM7/22/19
to JaCoCo and EclEmma Users
Thanks. :)
To unsubscribe from this group and stop receiving emails from it, send an email to jac...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/f361d62a-2232-49ac-8fe6-9fe79efb209a%40googlegroups.com.
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages