Package org.openclover.ant.tasks
Class CloverPassTask
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.openclover.ant.tasks.AbstractCloverTask
org.openclover.ant.tasks.CloverPassTask
- All Implemented Interfaces:
Cloneable
Clover Ant Task to report pass/fail status of a test run against
given targets. Targets may be given overall and/or per package level.
The build may optionally fail if targets are not met
- Since:
- Clover 1.1
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classInner class to gather the package level pass/fail coverage targets. -
Field Summary
Fields inherited from class org.openclover.ant.tasks.AbstractCloverTask
config, debugFields inherited from class org.apache.tools.ant.Task
target, taskName, taskType, wrapperFields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPackage(CloverPassTask.PackageRequirement requirement) Add a apcage spec to the list of packages to be checked for coverage.voidaddTestResults(org.apache.tools.ant.types.FileSet fileset) voidaddTestSources(org.apache.tools.ant.types.FileSet fileset) voidDo the work - checking the overall and per-package coverage against the givenm targets.org.openclover.core.cfg.Percentageorg.openclover.core.cfg.Percentageorg.openclover.core.cfg.PercentageList<org.apache.tools.ant.types.FileSet> doublevoidinit()voidsetCodeType(String codeTypeAsString) voidsetConditionalTarget(org.openclover.core.cfg.Percentage conditionalTarget) voidsetFailureProperty(String failureProperty) voidset the filter which controls which items are included in the log report.voidsetHaltOnFailure(boolean haltOnFailure) Set the flag indicating whether the build will be failed for failing to meet a target coverage.voidsetHistorydir(File historydir) voidsetIncludeFailedTestCoverage(boolean include) voidsetMethodTarget(org.openclover.core.cfg.Percentage methodTarget) voidsetSpan(org.openclover.core.cfg.Interval span) voidsetStatementTarget(org.openclover.core.cfg.Percentage statementTarget) voidsetTarget(org.openclover.core.cfg.Percentage percentValue) Set the overall system coverage targetvoidsetThreshold(org.openclover.core.cfg.Percentage threshold) Methods inherited from class org.openclover.ant.tasks.AbstractCloverTask
execute, getInitString, resolveInitString, setDebug, setInitString, setTmpDir, validateMethods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskTypeMethods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
-
Constructor Details
-
CloverPassTask
public CloverPassTask()
-
-
Method Details
-
setCodeType
-
init
public void init() throws org.apache.tools.ant.BuildException- Overrides:
initin classAbstractCloverTask- Throws:
org.apache.tools.ant.BuildException
-
addPackage
Add a apcage spec to the list of packages to be checked for coverage.- Parameters:
requirement- the package rquirement including the apckage name and percentage coverage required.
-
setHistorydir
-
getHistorydir
-
setThreshold
public void setThreshold(org.openclover.core.cfg.Percentage threshold) -
getThreshold
public double getThreshold() -
setTarget
public void setTarget(org.openclover.core.cfg.Percentage percentValue) Set the overall system coverage target- Parameters:
percentValue- the percentage coverage target for the build
-
getMethodTarget
public org.openclover.core.cfg.Percentage getMethodTarget() -
setMethodTarget
public void setMethodTarget(org.openclover.core.cfg.Percentage methodTarget) -
getStatementTarget
public org.openclover.core.cfg.Percentage getStatementTarget() -
setStatementTarget
public void setStatementTarget(org.openclover.core.cfg.Percentage statementTarget) -
getConditionalTarget
public org.openclover.core.cfg.Percentage getConditionalTarget() -
setConditionalTarget
public void setConditionalTarget(org.openclover.core.cfg.Percentage conditionalTarget) -
setFailureProperty
-
getFailureProperty
-
setFilter
set the filter which controls which items are included in the log report.- Parameters:
filterSpec- a comma separated set of values denoting the items to include in the report.
-
setSpan
public void setSpan(org.openclover.core.cfg.Interval span) -
addTestResults
public void addTestResults(org.apache.tools.ant.types.FileSet fileset) -
setIncludeFailedTestCoverage
public void setIncludeFailedTestCoverage(boolean include) -
addTestSources
public void addTestSources(org.apache.tools.ant.types.FileSet fileset) -
getTestSources
-
setHaltOnFailure
public void setHaltOnFailure(boolean haltOnFailure) Set the flag indicating whether the build will be failed for failing to meet a target coverage. If this is false the coverage target failures are logged- Parameters:
haltOnFailure- true if the build is to fail when targets are not met.
-
cloverExecute
public void cloverExecute()Do the work - checking the overall and per-package coverage against the givenm targets.- Specified by:
cloverExecutein classAbstractCloverTask
-