Clover Check Task
Description
The <clover-check> task allows a build to ensure that particular coverage targets have been met.
Attributes
| Attribute | Description | Required |
|---|---|---|
| target | The overall coverage target, expressed as a percentage | No |
| property | The name of a property which will contain the result of the coverage check. | No |
| messageProperty | The name of the property which contains a detailed report of which coverage targets have not been met. | No |
| haltOnFailure | If true the build will be stopped if coverage targets have not been met | No |
<namespace> Element
the namespace element allows you to specify coverage targets for specific namespaces.
Attributes
| Attribute | Description | Required |
|---|---|---|
| name | The namespace name | Yes |
| target | the coverage target expressed as a percentage. | Yes |
Examples
This example includes a check of overall coverage and the coverage of the NUnit.Core namespace
<target name="check">
<clover-check target="18%" haltOnFailure="false" property="covered" messageProperty="coverage.message">
<namespace name="NUnit.Core" target="40%"/>
</clover-check>
<if test="${covered}">
<echo message="Coverage Targets met" />
</if>
<ifnot test="${covered}">
<echo message="Coverage target failed = ${coverage.message}"/>
</ifnot>
</target>