Menu

Plug-In: Collect executions

Help
2012-05-09
2013-04-24
  • Andreas Kretschmer

    Hi

    in order for my bachelor exam
    I develop a plugin using the jacoco library.
    The instrumentation of the classes works fine,
    but i have a problem to collect the executions at runtime.

    what should I do to get the executions?
    How EclEmma do this exactly?

    thanks

     
  • Marc R. Hoffmann

    You get execution data from your runtime instance:

      void org.jacoco.core.runtime.IRuntime.collect(IExecutionDataVisitor executionDataVisitor, ISessionInfoVisitor sessionInfoVisitor, boolean reset)

    Cheers,
    -marc

     
  • Andreas Kretschmer

    Yes i know this from the "CoreTutorial" and there it works fine,
    but when i use the same struckture in my plugin and start the runtime-eclipse,
    the ExecutionData is emty :/

     
  • Marc R. Hoffmann

    Not sure what you're trying to do. One impoertant thing is that execution data is collected in the JVM that executes your instrumented classes. So in your case you probably launch some test program from Eclipse. So if you call the Runtime APIs in the Eclipse JVM you will not gat any data. You need to include some control code with your JVM under test.

    This is BTW exactly how the JaCoCo agent works.

     
  • Andreas Kretschmer

    I'm trying to develop a plug-in like EclEmma with some other features and for the coverage information i like to use Jacoco.
    So i have to add the Jacoco agent to the LaunchConfigurations am i rigth?

     
  • Marc R. Hoffmann

    > So i have to add the Jacoco agent to the LaunchConfigurations am i rigth?

    This is what EclEmma does in the background.