Clear Coverage Filters
Clear the existing filters on the view. This is processed before the XmlFilters flag.
<ClearCoverageFilters>true</ClearCoverageFilters>
Coverage Filters
Filters can either exclude elements from coverage metrics and reporting, or include elements into coverage metrics and reporting (excluding all elements that are not included). All include filters are applied before any exclude filters, but once all filters are applied, excluded items are not considered when applying other options.
NOTE: filtered items still exist in saved coverage data MergedCoverageDataFileName and reports. If you want excluded elements to be stripped from reports, use the //rdf flag ReportDataFilter.
<CoverageFilters> <CoverageFilter filterruledata=".nunit." filtertype="Assembly" regexrule="true" include="false" /> </CoverageFilters>
'filterruledata' specifies the regular expression or wildcard pattern that the filter matches element names against. Elements whose name matches the expression or wildcard are then included or excluded (depending on which type the filter is)
'filtertype' specifies the element type that the filter applies to. The filter's Pattern will be matched against the name of every element of the specified type.
Possible Values: Assembly, Namespace, Class, Method, Document
'regexrule' identifies the 'Pattern' as a regular expression or as a wildcard pattern.
'include' identifies the filter as an include filter (everything that matches the filter will be included) or as an exclude filter (everything that matches the filter will be excluded)
Rebased Source File Paths
When searching for source files, treat source files paths that begin with the <SourcePath /> as if they began with the <RebasedPath />. If multiple rebased paths are present, they are applied in the order in which they appear.
<RebasedPaths> <Path> <SourcePath>C:\dev\source</SourcePath> <RebasedPath>F:\test\build 3.2.223\source</RebasedPath> </Path> </RebasedPaths> </CoverageFilters>
'filterruledata' is the absolute path to the file(s) as they were on the build machine.
'filtertype' is the absolute path to the same file(s) as it is on the local machine.
Minimum Coverage Thresholds
Complete Edition Feature
Minimum coverage thresholds fail the build if the merged coverage data does not satisfy them. Thresholds can be set for any of the supported coverage types, for any particular value, from 0% to 100% (or any value >= 0 for the CyclomaticComplexity metric). Thresholds can apply to the overall coverage percentage, or to assemblies, namespaces, or classes.
<MinimumCoverage> <Threshold> <CoverageMetric>SymbolCoverage</CoverageMetric> <Pattern>system.io.path</Pattern> <Type>Class</Type> <Value>45.0</Value> </Threshold> </MinimumCoverage>
'Coverage Metric' specifies the metric this threshold applies to. Allowed values: SymbolCoverage, BranchCoverage, MethodCoverage, and CyclomaticComplexity
'Pattern' restricts the threshold to items of the given type whose name matches the value in this field The value can be a regular expression, or it can be a specific name. The value matches the fully-qualified name of the item, i.e. match a class by entering 'System.IO.Path' (case-insensitive match).
'Type' restricts the threshold to items of the given type
Allowed Values: View, Module, Namespace, Class
Default Value: 'View' (the overall coverage of the entire merged coverage data).
'Min Coverage Value' specifies the minimum value the given coverage metric is allowed to have. If the coverage value for the given metric is below this value, the build will fail. Allowed values: 0 - 100% for everything but CyclomaticComplexity. CyclomaticComplexity must be > 0.
Use Minimum Coverage
When set, NCover.Reporting will copy the FailBuildThresholds into the SatisfactoryThresholds, merging the two together to create SatisfactoryThresholds
<SatCoverageFromMinCoverage>True</SatCoverageFromMinCoverage>
Xml Report Filter
Works with the ReportType parameter of the XmlReports argument to strip unnecessary data from the xml reports. By default, the unnecessary data is retained in the report and ignored, but for large projects the unnecessary data makes the xml reports render slowly on some build systems.
<ReportDataFilter>Assembly | Namespace</ReportDataFilter>
Report Invalid Files
By default, when preparing coverage data for reporting, NCover Reporting will not create any reports if any of the coverage files are invalid coverage files. Using this argument tells NCover Reporting to report any invalid coverage files and create reports from the data in the valid coverage files (if any).
<ReportInvalidFiles>true</ReportInvalidFiles>
Satisfactory Coverage Thresholds
Complete Edition Feature
Satisfactory coverage thresholds report the items in the merged coverage data that do not satisfy them. Thresholds can be set for any of the supported coverage types, for any particular value, from 0% to 100% (or any value greater than 0 for the CyclomaticComplexity metric). Thresholds can apply to the overall coverage percentage, or to assemblies, namespaces, or classes.
<SatisfactoryCoverage> <Threshold> <CoverageMetric>SymbolCoverage</CoverageMetric>
<Pattern>system.io.path</Pattern> <Type>Class</Type> <Value>45.0</Value> </Threshold> </SatisfactoryCoverage>
'CoverageMetric' specifies the metric this threshold applies to.
Allowed values: SymbolCoverage, BranchCoverage, MethodCoverage, and CyclomaticComplexity
'Pattern' restricts the threshold to items of the given type whose name matches the value in this field The value can be a regular expression, or it can be a specific name. The value matches the fully-qualified name of the item, i.e. match a class by entering 'System.IO.Path' (case-insensitive match).
'Type' restricts the threshold to items of the given type
Allowed Values: View, Assembly, Namespace, Class
Default Value: 'View' (the overall coverage of the entire merged coverage data).
'Value' specifies the minimum value the given coverage metric is allowed to have. If the coverage value for the given metric is below this value, the item will be reported.
Allowed values: 0 - 100% for everything but CyclomaticComplexity. CyclomaticComplexity must be > 0.
Max Failed to Report
By default, NCover.Reporting will only show the first 50 items that fail the minimum coverage thresholds. Set this value to change how many items NCover.Reporting will list in detail (the total number that failed is always reported).
<MaxFailedToShow>500</MaxFailedToShow>