Description / Features
Emma is an Open Source and robust code coverage tool. By default, Sonar is delivered with JaCoCo and Cobertura but if you prefer Emma you just have to install this plugin and go back to your favorite practice: the test driven development.
Usage & Installation
- Copy the jar into /extensions/plugins/ directory
- Restart Sonar Web server
To activate Emma on all projects:
- Log in as administrator
- Go to Configuration > Global Settings > Code Coverage
- Set the property "Code coverage plugin" to "emma"
To activate Emma on selected projects:
- Add the property 'sonar.core.codeCoveragePlugin=emma' when executing the maven plugin. This can be set in pom.xml or in command line.
As it is possible for surefire and Cobertura, reusing already generated Emma reports is possible: the 'sonar.emma.reportPath' must be defined to indicate the directory where the .ec and the .em Emma files are generated.
|Supported report formats|
Note that only reports of offline instrumentation are currently supported (*.ec and *.em files).
XML or HTML formats are not.
See also the Code Coverage by Unit Tests tutorial.
Branch coverage is not calculated as such notion does not exist in Emma.