Hi,

thanks for this report! In fact the JaCoCo agent can only be installed to a forked jvm. If now JaCoCo agent is installed no execution data is recorded and written to the *.exec file.

Not sure how we can "fix" this in JaCoCo beside adding documentation to the prepare-agent goal? JaCoCo does not control the surefire plugin.

BTW, in Ant the "coverage" task wraps the junit task and explicitely checks for the correct fork settings.

Best regards,
-marc

On 14.04.14 20:22, [email protected] wrote:
Precautionary note: I found that "forkMode" parameter is deprecated as of 
maven-surefire-plugin:2.14.  Meaning: I am aware that this property should not be used in 
current versions.  I have still posted this for projects that might  be on older versions 
of the plugin.

When the maven-surefire-plugin has been configured with forkMode=never, the "prepare-agent" never 
generates the ${destFile}.  Note that the default value for "forkMode" is "once".  I am 
expecting the agent would be able to attach to the running tests, but that is still uncertain to me.

Should I expect that exec files are generated with forkMode=never?

Thanks, and keep up the great work!

Steps to reproduce
--------------
I am uncertain whether this is indeed expected behavior, so I have not filed a 
GitHub issue, or investigated a fix at this time.  What I do have are steps to 
reproduce.

Steps to reproduce:
1. Checkout source code referenced at this [blog post] (although any project 
that generates a report could be used to demonstrate).
svn co 
https://designbycontract.googlecode.com/svn/trunk/examples/testing/test-doubles
2. Run "mvn clean package -DforkMode=never"
3. Verify reporter fails because it finds no *.exec files.
4. Verify no *.exec files are generated in ${destFile} location.

Verified configurations:
* jacoco-maven-plugin: 0.5.5.201112152213, 0.7.0.201403182114
* Windows 7
* Maven 2.2.1, 3.1.1
* maven-Surefire-plugin 2.4.3, 2.13


References:
[blog post]: 
http://www.agile-engineering.net/2012/01/unit-test-code-coverage.html


--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to