When running coverage using the dotCover console runner, typically you should pass some arguments to the covered application.
Arguments with relative paths
If arguments contain relative paths, the console runner automatically converts them to the absolute ones according to the following rules:
- Relative paths specified in an XML configuration file are considered relative to the location of this file.
- Relative paths specified in the command line are considered relative to the current working directory.
For example, you want to cover E:\Tests\Builds\MyTests.dll using NUnit. Your current directory is E:\Tests\Builds\.
E:\Tests\Builds>c:\dotCoverCmd\dotcover.exe analyse /TargetExecutable="C:\Program Files\NUnit 2.6\bin\nunit-console.exe" /TargetArguments="MyTests.dll /xml=..\Coverage\Cover.xml" /Output="CoverageReport.html" /ReportType="HTML"
NUnit will get the following arguments:
Arguments with spaces in paths
If arguments contain paths with spaces, you should escape them with additional double quotes and a backslash, e.g.,
... /TargetArguments="\"D:\My Projects\My Application\bin\Debug\AppTests.dll""