0

I was looking for a TestCoverage for .netCore Xunit.

I found OpenCover, but i have no sucess to execute the command to run it:

C:\Users\andre.silva\AppData\Local\Apps\OpenCover\OpenCover.Console.exe -target:"C:\Users\andre.silva\.dnx\runtimes\dnx-clr-win-x86.1.0.0-rc1-update1\bin\dnx.exe" -targetargs:"--lib dotnet test" -output:coverage.xml -register:user -filter:"+[*]* -[xunit*]*"

Error: Unable to resolve project

Does Anybody know if OpenCover can runwith .NETCore projects?

Tks guys

André IT
  • 45
  • 7
  • I improved my command to: `C:\Users\andre.silva\.nuget\packages\OpenCover\4.6.519\tools\OpenCover.Console.exe -target:"C:\Program Files\dotnet\dotnet.exe" -targetargs:"test C:\github\API_AspNetCore\test\test.csproj" -register:user -filter:"+[*]* -[xunit*]*" -oldStyle`. the answer was **No results, this could be for a number of reasons...the most common reason is missing PDBs** – André IT Jun 04 '17 at 17:24

2 Answers2

2

With the current released version you will need to use full pdbs for it to work.

Shaun Wilde
  • 8,228
  • 4
  • 36
  • 56
  • Tks. I improved my command to: `C:\Users\andre.silva\.nuget\packages\OpenCover\4.6.519\tools\OpenCover.Console.exe -target:"C:\Program Files\dotnet\dotnet.exe" -targetargs:"test C:\github\API_AspNetCore\test\test.csproj" -register:user -filter:"+[*]* -[xunit*]*" -oldStyle. Do you know how can i modify my command to work with full pdbs? tks so much... – André IT Jun 04 '17 at 17:16
  • I improved my command to: `C:\Users\andre.silva\.nuget\packages\OpenCover\4.6.519\tools\OpenCover.Console.exe -target:"C:\Program Files\dotnet\dotnet.exe" -targetargs:"test C:\github\API_AspNetCore\test\test.csproj" -register:user -filter:"+[*]* -[xunit*]*" -oldStyle`. the answer was **No results, this could be for a number of reasons...the most common reason is missing PDBs** – André IT Jun 04 '17 at 17:24
  • 1
    Just input Full in csproj file :) tks – André IT May 24 '18 at 13:33
0

I solved the problem.

I was running a command with a simple 'dotnet test' but i should use 'dotnet xunit'

Just goes to your root folder in test project and run:

C:\Users\andre.silva\.nuget\packages\OpenCover\4.6.519\tools\OpenCover.Console.exe -target:"C:\Program Files\dotnet\dotnet.exe" -targetargs:"xunit" -register:user -filter:"+[*]* -[xunit*]*" -oldStyle

Tks Guys

Andrew Gray
  • 3,593
  • 3
  • 35
  • 62
André IT
  • 45
  • 7