NCoverExplorer.NAntTasks
![]() ![]() ![]() |
v1.3.6.15 |
NAnt task for automating NCover.Console.exe, with both NCover 1.3.3 and 1.5.x support. Note that this task will self register CoverLib.dll by default using the registry (does not require local admin).
Attribute | Type | Description | Required |
---|---|---|---|
assemblyList | string | Used to specify the assemblies to be profiled by specifically naming them. Values should be separated by semi-colons and not include suffixe or path (and case sensitive) as this is how they are identified by the CLR. e.g. "MyApp.Main;MyApp.Core". | False |
commandLineArgs | string | The arguments to pass to the command line executable to be launched by NCover (such as nunit-console.exe). | False |
commandLineExe | string | The command line executable to be launched by NCover (such as nunit-console.exe). | False |
coverageFile | string | The filename for the output coverage.xml file (default). | False |
excludeAttributes | string | If coverage exclusion attributes have been applied (NCover 1.5.4 onwards) specify the full namespace to the attribute including the "Attribute" suffix - e.g. "CoverageExcludeAttribute" if defined in no namespace. Separate multiple attributes with semi-colons. | False |
logFile | string | Gets or sets the logfile name to write to if logLevel is set to anything other than "Quiet". The default is "coverage.log". | False |
logLevel | NCoverLogLevel | What level of NCover logging to provide. Values are "Quiet", "Normal" (default) and "Verbose". Note that due to a current bug in NCover 1.5.4 there is no different between Quiet and Normal since the //q argument (NoLog=true) will lock NCover. So logging is always on for NCover 1.5.4 | False |
profiledProcessModule | string | Gets or sets the profiled process module name. Use this argument when the executable being launched is not the actual process you want to profile coverage for. | False |
profileIIS | bool | Determines whether to profile under IIS (//iis). Default value is false. | False |
profileService | string | The service name to profile if any (//svc). Default is none. | False |
program | string | The name of the executable that should be used to launch the external program. | False |
registerProfiler | bool | Determines whether to register NCover CoverLib.dll on each run. The default is true . You would set this to false if using TypeMock due to a conflict in registered profilers. If set to true, the NCover task uses a reference counting approach to minimise the chance of issues when simultaneous builds. |
False |
workingDirectory | string | Gets or sets the working directory for the command line executable. | False |
xmlFormat | NCoverXmlFormat | Gets or sets a value indicating the xml output format to write (new in NCover 1.5.7). Default value is "Xml1", alternate option is "Xml2" which nests method nodes within class nodes. Note however that "Xml2" is for future use and is not yet supported by NCoverExplorer as of version 1.3.6. | 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 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" />
<ncover commandLineExe="${nunit.path}\nunit-console.exe" commandLineArgs="${build.path}\myapp.tests.dll" > </ncover>
<ncover commandLineExe="${nunit.path}\nunit-console.exe" commandLineArgs="${build.path}\myapp.tests.dll" registerProfiler="false" > </ncover>
<ncover program="C:\Program Files\NCover\ncover.console.exe" commandLineExe="${nunit.path}\nunit-console.exe" commandLineArgs="${build.path}\myapp.tests.dll" > </ncover>
<ncover program="C:\Program Files\NCover\ncover.console.exe" commandLineExe="MyLauncher.exe" profiledProcessModule="LaunchedProcess.exe" > </ncover>
<ncover program="tools\ncover\ncover.console.exe" commandLineExe="${nunit.path}\nunit-console.exe" commandLineArgs="myapp.tests.dll /xml="c:\my results\test.xml"" assemblyList="myapp.main;myapp.core" excludeAttributes="CoverageExcludeAttribute" > </ncover>
<ncover program="tools\ncover\ncover.console.exe" commandLineExe="${nunit.path}\nunit-console.exe" commandLineArgs="myapp.tests.dll" coverageFile="myapp.coverage.xml" logLevel="Verbose" logFile="myapp.coverage.log" workingDirectory="${build.path}" excludeAttributes="CoverageExcludeAttribute" > <assemblies basedir="${build.path}"> <include name="myapp.*.dll" /> </assemblies> </ncover>