Skip to content
This repository was archived by the owner on Oct 1, 2020. It is now read-only.
This repository was archived by the owner on Oct 1, 2020. It is now read-only.

Support coverage for spawned (Java) child processes (Feature request) #100

Open
@nlang5555

Description

@nlang5555

The desired use case is to collect coverage when JUnit testing a Java 'main' class. Typically, such a 'main' class is tested by spawning it in its own process during the JUnit test. A naive process execution (e.g. exec 'java acme.Main') cannot collect coverage, since it does not load the JaCoCo agent. So, it is understood that at least some JaCoCo argument must be passed in the exec line. However, it is hard to see how that argument can be properly constructed from within the JUnit test. At least the following is unknown/hard to obtain:

  • Exact classpath of the jacoco agent
  • Port of the Jacoco server
  • Sessionid to be used

Ideally, the Emma plugin would make the required JaCoCo argument available as a 'defined' property, e.g. 'jacoco.jvm.arg', available for application during the JUnit test. In this way, child processes can easily be constructed with the appropriate JaCoco configuration argument.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions