すべてのバージョン
Clover 4.0 ドキュメントClover 3.3 ドキュメント
Clover 3.2 ドキュメント
その他...
On this page:
Install the Clover-for-Grails plugin by running the following Grails command in the root of your Grails project directory.
grails install-plugin clover
For more installation options or to upgrade this plugin, please see Clover-for-Grails Installation and Upgrade Guide.
To generate a basic Clover code coverage report, you need to add the Clover option -clover.on to the grails test-app command line target for running unit tests against your Grails project.
grails test-app -clover.on -clover.view
Adding the Clover option -clover.view to this Grails command makes the report open in a browser window immediately after generation. If you omit this command line option, Clover will generate a report that you can then open manually.
clover.license file to the grails command lineIf you have not placed your clover.license file within your Grails project or user home directory (as indicated in the Installation Guide), you can pass the license file's location to the grails command line by adding the Clover option -clover.license.path=/path/to/clover.license:
grails test-app -clover.on -clover.license.path=/path/to/clover.license
On Windows platform you must put the "-clover.license.path=c:\path\to\clover.license" in double quotes, otherwise it won't work (it's a Grails feature).
Clover-for-Grails supports the configuration options outlined in the code sample below. All of these configuration options are defined in a single clover {} code block, which itself is defined within the Groovy build configuration file (BuildConfig.groovy) of your Grails project.
The BuildConfig.groovy file is located in the grails-app/conf subdirectory of your Grails project's root directory.
clover {
on = true|false // a boolean value indicating whether or not clover is enabled
license.path = "/path/to/clover.license" // the location of the clover license file, if not in one of the default locations.
debug = true|false // a boolean to toggle debugging on or off
verbose = true|false // a boolean to toggle verbose output on or off; can be overridden by debug=true; since 3.1.6
initstring = "" // the location to use for Clover to write out its database
srcDirs = [] // an array of Strings of source directories to including in instrumentation
includes = [] // an array of String Ant Glob Patterns to include for instrumentation
excludes = [] // an array of String Ant Glob Patterns to exclude for instrumentation
setuptask = {} // Gant script to be called instead of the default clover-setup
reporttask = {} // Gant script to be called when tests have finished
historypointtask = {} // Gant script to be called when clover history point has to be created
json = true|false // a boolean to enable generation of json output in report; used if custom 'reporttask' script is not defined
title = "" // a report title
view = true|false // launch generated report in a web browser
}
More details for:
If you find that Clover-for-Grails runs out of memory, try increasing the Grails PermGen allocation by either setting the JAVA_OPTS environment variable:
export JAVA_OPTS="-XX:MaxPermSize=192m"
set JAVA_OPTS="-XX:MaxPermSize=192m"
Alternatively, you can define this variable in the startGrails (Linux/UNIX/Mac OS X) or startGrails.bat (Windows) script in the <Grails Home Directory>/bin directory.
Grails 1.2.2+ should have a larger default maximum PermGen allocation size.
Clover-for-Grails Installation and Upgrade Guide
Clover-for-Grails User's Guide