Reputation: 2992
I am running dotcover command line tool on my unit test project. As specified by https://www.jetbrains.com/help/dotcover/Running_Coverage_Analysis_from_the_Command_LIne.html#, I run the following command
C:\files\dotcover cover
/TargetExecutable="C:\files\MockTestSample\packages\NUnit.ConsoleRunner.3.11.1\tools\nunit3-console.exe"
/TargetArguments="C:\files\mocktestsample\Tests\bin\Debug\tests.dll"
/Output="SampleCoverageReport.json"
/ReportType="JSON"
it beautifully generates the report data in a json format. But when I try to generate an html report:
C:\files\dotcover\dotcover cover
/TargetExecutable="C:\files\MockTestSample\packages\NUnit.ConsoleRunner.3.11.1\tools\nunit3-console.exe"
/TargetArguments="C:\files\mocktestsample\Tests\bin\Debug\tests.dll"
/Output="SampleCoverageReport.html"
/ReportType="HTML"
I simply want to see the code coverage report as html. However, when I go to my SampleCoverageReport.html file, I did see the coverage, but I am not able to see the sources. When I clicked on a project it says "no source available". Am I missing something? I just followed what is written exactly in the documentation.
Upvotes: 3
Views: 1801
Reputation: 131
When generating an HTML report dotCover tries to find source code files using paths saved by the compiler in pdb files. If these paths are not valid anymore (e.g. the source files have been moved/deleted after the compilation, or if your application has been built on some other machine), than dotCover can't include source code to the HTML report.
Starting with version 2020.1 there will be a new command line parameter 'SourcesSearchPaths' where you will be able to specify actual path(s) to the source code.
Also please note that source code is available only for method nodes of the coverage tree.
Upvotes: 1