automated emma code coverage

I am looking at switching on the emma code coverage integrated with teamcity but I just need to confirm that the instrumented class is kept in a seperate area from the normally compiled class. In other words, when I build my war file it is not going to include instrumented code.

Looking in the build log I see that the intrument path "-cp" is set to my classes directory but no mention of the "-d" option which would output instrumented classes to a seperate directory.
Do I need to set something explicitly?

Thanks in advance

4 comments
Comment actions Permalink

Hello,

   TeamCity instruments class files in-place. So you rather need 2 build configurations - one to collect coverage and run tests,
    and another to build the production distribution. In TeamCity 4.0 you can use snapshot dependencies to ensure that both configurations
   will use the same source revisions.

   Regards,
   KIR

0
Comment actions Permalink

and I see the "-m" option is used which means "-d" would be ignored anyway, so basically I think there is instrumented code in my war file. Can I change this, or will it make teamcity unable to process coverage data?

0
Comment actions Permalink

When code coverage is enabled, classes are instrumented by EMMA integration.
You cannot use built-in coverage in TeamCity without instrumentation on disk, runtime instrumentation is not supported.

You can setup some external coverage manually and provide any report as a build artifact with a separate tab in WebUI

Regards,
KIR

0

Please sign in to leave a comment.