NCoverExplorer.NAntTasks
![]() ![]() ![]() |
v1.3.6.15 |
NAnt task for automating NCoverExplorer.Console. Using this task you can merge coverage files from NCover, produce xml coverage reports for use with CruiseControl.Net, produce html report files directly, fail automated builds if coverage thresholds are not met and apply a range of detail to the reports produced such as sorting, filtering and coverage exclusions.
Attribute | Type | Description | Required |
---|---|---|---|
failMinimum | bool | Whether to fail the task if the satisfactory coverage threshold is not reached. NCoverExplorer console application will return exit code 3. | False |
filter | string | The filtering if any to apply (use numeric value or string name). 0 / None, 1 / HideUnvisited, 2 / HideFullyCovered, 3 / HideThresholdCovered | False |
htmlReportName | string | The filename for generating an html report. | False |
mergeFileName | string | The filename for the merge of the coverage xml files. | False |
outputDir | string | Gets or sets the output directory for the reports. | False |
program | string | The name of the executable that should be used to launch the external program. | False |
projectName | string | The project name to appear in the report. | False |
reportType | string | The type of report to produce (use numeric value or string name). 0 / None, 1 / ModuleSummary, 2 / NamespaceSummary, 3 / ModuleNamespaceSummary, 4 / ModuleClassSummary, 5 / ModuleClassFunctionSummary | False |
satisfactoryCoverage | float | The satisfactory coverage percentage for display in the reports. | False |
showExcluded | bool | Determines whether to include the coverage exclusions in the report. The default is true. | False |
sort | string | The sorting if any to apply (use numeric value or string name). 0 / Name, 1 / ClassLine, 2 / CoveragePercentageAscending, 3 / CoveragePercentageDescending, 4 / UnvisitedSequencePointsAscending, 5 / UnvisitedSequencePointsDescending, 6 / VisitCountAscending, 7 / VisitCountDescending, 8 / FunctionCoverageAscending, 9 / FunctionCoverageDescending | False |
xmlReportName | string | The filename for generating an xml report. | False |
failonerror | bool | Determines if task failure stops the build, or is just reported. The default is true. | False |
if | bool | If true then the task will be executed; otherwise, skipped. The default is true. | False |
timeout | int | The maximum amount of time the application is allowed to execute, expressed in milliseconds. Defaults to no time-out. | False |
unless | bool | Opposite of if . If false then the task will be executed; otherwise, skipped. The default is false. |
False |
verbose | bool | Determines whether the task should report detailed build log messages. The default is false. | False |
Attribute | Type | Description | Required |
---|---|---|---|
useruntimeengine | bool | Specifies whether the external program should be executed using a runtime engine, if configured. The default is false. | False |
Represents a coverage exclusion for passing to NCoverExplorer.Console in the configuration file.
Attribute | Type | Description | Required |
---|---|---|---|
enabled | bool | Indicates if the exclusion is enabled. | False |
isRegex | bool | Indicates if the pattern is a regular expression. | False |
pattern | string | The pattern to match. | False |
type | string | The exclusion type of Assembly, Namespace or Class. | False |
A module threshold is used by the console application (only currently) to set coverage thresholds at a more granular level than just at project level.
Attribute | Type | Description | Required |
---|---|---|---|
moduleName | string | Gets or sets the name of the module. | False |
satisfactoryCoverage | float | Gets or sets the coverage threshold for this module. | False |
Represents a command-line argument.
Attribute | Type | Description | Required |
---|---|---|---|
dir | directory | The value for a directory-based command-line argument; will be replaced with the absolute path of the directory. | False |
file | file | The name of a file as a single command-line argument; will be replaced with the absolute filename of the file. | False |
if | bool | Indicates if the argument should be passed to the external program. If true then the argument will be passed; otherwise, skipped. The default is true. | False |
line | string | List of command-line arguments; will be passed to the executable as is. | False |
path | <path> | The value for a PATH-like command-line argument; you can use : or ; as path separators and NAnt will convert it to the platform's local conventions, while resolving references to environment variables. | False |
unless | bool | Indicates if the argument should not be passed to the external program. If false then the argument will be passed; otherwise, skipped. The default is false. | False |
value | string | A single command-line argument; can contain space characters. | False |
A single command-line argument containing a space character.
<arg value="-l -a" />
Two separate command-line arguments.
<arg line="-l -a" />
A single command-line argument with the value \dir;\dir2;\dir3
on DOS-based systems and /dir:/dir2:/dir3
on Unix-like systems.
<arg path="/dir;/dir2:\dir3" />
<ncoverexplorer program="tools\ncoverexplorer\ncoverexplorer.console.exe" projectName="My Project" outputDir="${build.reports}" satisfactoryCoverage="80" reportType="4" xmlReportName="CoverageSummary.xml" > <fileset> <include name="coverage.xml" /> </fileset> </ncoverexplorer>
<ncoverexplorer program="tools\ncoverexplorer\ncoverexplorer.console.exe" projectName="My Project" outputDir="${build.reports}" satisfactoryCoverage="80" reportType="ModuleClassFunctionSummary" htmlReportName="CoverageSummary.html" showExcluded="True" > <fileset> <include name="coverage.xml" /> </fileset> <exclusions> <exclusion type="Assembly" pattern="*.Tests" /> </exclusions> </ncoverexplorer>
<ncoverexplorer program="tools\ncoverexplorer\ncoverexplorer.console.exe" projectName="My Project" outputDir="${build.reports}" satisfactoryCoverage="80" reportType="ModuleClassSummary" htmlReportName="CoverageSummary.html" showExcluded="True" sort="CoveragePercentageDescending" filter="HideFullyCovered" > <fileset> <include name="coverage.xml" /> </fileset> <exclusions> <exclusion type="Assembly" pattern="*.Tests" /> </exclusions> </ncoverexplorer>
<ncoverexplorer program="tools\ncoverexplorer\ncoverexplorer.console.exe" outputDir="${build.reports}" reportType="None" mergeFileName="MyApp.CoverageMerged.xml" > <fileset> <include name="*.coverage.xml" /> </fileset> </ncoverexplorer>
<ncoverexplorer program="tools\ncoverexplorer\ncoverexplorer.console.exe" projectName="My Project" reportType="None" satisfactoryCoverage="80" failMinimum="True" > <fileset> <include name="coverage.xml" /> </fileset> </ncoverexplorer>
<ncoverexplorer program="tools\ncoverexplorer\ncoverexplorer.console.exe" projectName="My Project" reportType="None" satisfactoryCoverage="80" failMinimum="True" > <fileset> <include name="coverage.xml" /> </fileset> <moduleThresholds> <moduleThreshold moduleName="MyApp.1.dll" satisfactoryCoverage="75" /> <moduleThreshold moduleName="MyApp.2.dll" satisfactoryCoverage="85" /> </moduleThresholds> </ncoverexplorer>
<ncoverexplorer program="tools\ncoverexplorer\ncoverexplorer.console.exe" projectName="My Project" reportType="ModuleNamespaceSummary" sort="Name" filter="None" outputDir="${build.reports}" xmlReportName="CoverageSummary.xml" htmlReportName="CoverageSummary.html" mergeFileName="CoverageMerge.xml" showExcluded="True" satisfactoryCoverage="80" failMinimum="True"> <fileset> <include name="coverage.xml" /> </fileset> <exclusions> <exclusion type="Assembly" pattern="*.Tests" /> <exclusion type="Namespace" pattern="MyApp.SomeNamespace" /> <exclusion type="Namespace" pattern="MyApp\.(\w*\.)?" isRegex="true" /> <exclusion type="Class" pattern="MyApp.SomeNamespace.SomeClass" /> </exclusions> <moduleThresholds> <moduleThreshold moduleName="MyApp.1.dll" satisfactoryCoverage="75" /> <moduleThreshold moduleName="MyApp.2.dll" satisfactoryCoverage="85" /> </moduleThresholds> </ncoverexplorer>