Hi,

At start JaCoCo creates file with a zero size to ensure that location is 
writable, then it uses "Runtime.addShutdownHook" to write data at the end 
of JVM execution, but indeed if JVM is not terminated properly, then 
shutdown hooks are not guaranteed to be executed. However there are other 
methods of requesting data - see "Can I collect coverage information 
without stopping the JVM?" in our FAQ ( 
http://www.eclemma.org/jacoco/trunk/doc/faq.html ). Also if you able to 
provide simple/minimalistic example of a reproducer of your problem with 
Buildr, then might be possible to check it precisely. Also seems that there 
are some work on seamless integration of JaCoCo with Buildr - 
see https://github.com/apache/buildr/blob/master/addon/buildr/jacoco.rb , 
so that you might check with authors of this addon.

Could be noted that as far as I know Cobertura also uses shutdown hook and 
also has troubles, if JVM isn't terminated properly.

What is the best coverage tool probably should be decided by users and not 
by JaCoCo developers, so I leave this question unanswered ;)

Best regards,

On Tuesday, June 2, 2015 at 3:38:26 PM UTC+2, knowlestk@... wrote:
>
> Hi all, 
>
> I am trying to use Jacoco to measure test coverage of our small number of 
> tests. I am using Buildr along with the JAVA_OPTS set to 
> "-javaagent:/path/to/jacocoagent.jar". The defaults for Jacoco creates a 
> new jacoco.exec file in the current directory. However this file is empty 
> with 0 bytes. If I use the classdumpdir option, I do see the various test 
> classes placed into the dump directory. 
>
> Why then, is the jacoco.exec file not getting filled with data? I have 
> seen one other place mentioning that jvm needs to be shutdown in order to 
> dump the data to that file. Does anyone else have experience with Jacoco 
> through the java agent. We do not use Maven or Ant, as Buildr is what we 
> use for our builds and tests. 
>
> Side question - I understand that Jacoco is the freshest method to use for 
> Java test coverage, as opposed to others such as Cobertura and Clover. Is 
> Jacoco the best way to go? 
>
> Thank you. 
>

-- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/1b4f9061-74e1-4b80-a50c-7aa5df95c9c3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to