Subprocess code coverage tracking

45 views
Skip to first unread message

vlamik...@gmail.com

unread,
Jul 13, 2017, 9:05:47 PM7/13/17
to JaCoCo and EclEmma Users, Aymeric Fromherz, Kasper Søe Luckow
Hello everybody,

Currently I am working on the Symbolic Java Path Finder test suite and faced up with the problem of code coverage measurement. Namely, many test cases require running subprocess with custom JPF virtual machine and then execute instructions inside it to verify class methods, etc. Unfortunately, the code executed in the subprocess is not currently tracked by EclEmma (see attachment). Could you suggest anything? We are considering calling JaCoCo on the spawning VM and further results merging. Maybe there is any better solution? Perhaps, out-of-the-box? 

Best Regards,
Vladimir Mikhaylov.
print.png

Evgeny Mandrikov

unread,
Jul 19, 2017, 8:55:28 PM7/19/17
to JaCoCo and EclEmma Users, aymeric....@ens.fr, kslu...@gmail.com
Hi,

Short answer is that there is no such feature out of the box, however:

EclEmma is based on JaCoCo and starts JVM with JaCoCo agent in "tcpclient" output mode (see http://www.jacoco.org/jacoco/trunk/doc/agent.html) that connects back to EclEmma to report code coverage. Subprocesses obviously do not have agent magically. Tracking of subprocesses is tough OS-dependent task with many corner cases, even not counting the need to modify startup arguments. This statement is based on 3 years of experience in development/maintainance of process-tracking application that is part of a bigger commercial product. So I'm pretty sure that we'll never add to JaCoCo (and hence EclEmma) ability to automatically attach agent to subproesses. However if you control the creation of subprocess, then you can modify it so to use agent. But EclEmma accepts only one connection. Not sure about added-value if we allow multiple connections, because this raises quite some questions and there are simpler alternatives:
there is no problem with number of connections in case of usage of JaCoCo outside/without Eclipse and EclEmma, which is actually the way to integrate gathering of code coverage into automated build process;
or child processes can save coverage data into file (JaCoCo agent output mode "file" that is default) that can be imported into Eclipse using EclEmma.


Regards,
Evgeny
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages