Merrin
Merrin

Reputation: 675

How do I instrument code coverage for JMockit where src code is a dependency?

I have a maven project for tests where src code is complied into classes and made available as a dependency. Now I need to write tests with JMockit and get code coverage reports.

Based on the documentation(http://jmockit.org/tutorial/CodeCoverage.html) I won't be able to get coverage where src files are .class files in a jar. How do I handle that situation?

I'm open to use any code coverage tool as long as it works with JMockit.

Upvotes: 0

Views: 120

Answers (1)

Rogério
Rogério

Reputation: 16380

The HTML coverage report will include any classes for which the sources can be found. You can list all source directories to be searched by setting the coverage-srcDirs system property (see list of all properties in http://jmockit.org/tutorial/CodeCoverage.html#configuration).

Also, if the classes of some dependency are in a jar file, then they'll need to be selected in the coverage-classes property (since classes from jar files are left out by default).

Upvotes: 0

Related Questions