Home | Forums

Clover Check Task


The <clover-check> task allows a build to ensure that particular coverage targets have been met.


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.


Attribute Description Required
name The namespace name Yes
target the coverage target expressed as a percentage. Yes


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%"/>
          <if test="${covered}">
            <echo message="Coverage Targets met" />
          <ifnot test="${covered}">
            <echo message="Coverage target failed = ${coverage.message}"/>