Plugins You can find out about all the publicly available Grails plugins.

OpenClover Code Coverage for Grails

2 votes
Dependency:
compile "org.grails.plugins:clover:4.2.0"

 Documentation

Summary

A plugin that integrates OpenClover into Grails projects. OpenClover is free and open-source code coverage tool that produces beautiful reports which are highly configurable and extensible. See more on http://openclover.org

Installation

Installation of Clover for Grails

1) Using the BuildConfig

grails-app/conf/BuildConfig.groovy:

grails.project.dependency.resolution = {
    plugins {
        compile 'org.grails.plugins:clover:4.2.0'
    }
    // For *Grails 2.2* or later you must also add a dependency to the Clover Core
    // or use the "legacyResolve true" option
    dependencies {        
        compile 'org.openclover:clover:4.2.0'
    }
}

2) Using POM

grails-app/conf/BuildConfig.groovy:

grails.project.dependency.resolution = {
    pom true
}

pom.xml:

<dependency>
    <groupId>org.grails.plugins</groupId>
    <artifactId>clover</artifactId>
    <version>4.2.0</version>
    <scope>compile</scope>
    <type>zip</type>
</dependency>
<!-- For *Grails 2.2* and later you must also add a dependency to the Clover Core -->
<dependency>
    <groupId>org.openclover</groupId>
    <artifactId>clover</artifactId>
    <version>4.2.0</version>
    <scope>compile</scope>
    <type>jar</type>
</dependency>

Using Clover

Once the plugin is installed, instrument code, execute your tests and generate report by

grails test-app -clover.on -clover.view

Customizing Clover

For further instructions on using Clover for Grails check out the Online Documentation

Description

A plugin that integrates Clover into Grails projects. Clover is a Code Coverage tool that produces beautiful reports which are highly configurable and extensible. Clover not only reports which lines of code were executed during a test run, it also reports which tests hit which lines of code.

Clover's reports include:

  • Tag Clouds of your entire project that compare Complexity with Coverage allowing to quickly focus on the most critical code parts
  • A TreeMap to visualise the most complex, uncovered areas of your project
  • Fully Cross Referenced HTML view of your source code
  • Test Optimization speeds-up your daily development by running only these tests which are relevant to source changes made
  • and much more