Skip to content

Add info how to generate cover report for .NET Core#22

Merged
larzw merged 1 commit into
codecov:masterfrom
jahav:net-standard-doc
Nov 29, 2017
Merged

Add info how to generate cover report for .NET Core#22
larzw merged 1 commit into
codecov:masterfrom
jahav:net-standard-doc

Conversation

@jahav

@jahav jahav commented Nov 28, 2017

Copy link
Copy Markdown
Contributor

.NET Core has worse tool support than .NET Framework and requires few different steps.

.NET Core has worse tool support than .NET Framework and requires few different steps.
@codecov

codecov Bot commented Nov 28, 2017

Copy link
Copy Markdown

Codecov Report

Merging #22 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #22   +/-   ##
=======================================
  Coverage   66.66%   66.66%           
=======================================
  Files           1        1           
  Lines           9        9           
=======================================
  Hits            6        6           
  Misses          3        3

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b1e9674...b939379. Read the comment docs.

@jahav

jahav commented Nov 28, 2017

Copy link
Copy Markdown
Contributor Author

If you want to test it out, just create .NET Core project, the one in this repository is for .NET Framework.

Instructions to make a test .NET Core project:

mkdir example-csharp
cd example-csharp
dotnet new sln --name CodecovProject
dotnet new classlib --name UnitTestTargetProject
dotnet new xunit --name MyUnitTests
dotnet add MyUnitTests reference UnitTestTargetProject\UnitTestTargetProject.csproj

Copy MyTargetClassTests.cs and MyTargetClass.cs from this project to their respective .NET Core projects.

Add DebugType full to both .csproj files, so the PropertyGroup looks like this:

  <PropertyGroup>
    <TargetFramework>netstandard2.0</TargetFramework>
    <DebugType>full</DebugType>
  </PropertyGroup>

Verify that tests are working.

cd MyUnitTests
dotnet test

Generate cover report.

OpenCover.Console.exe -register:user -target:"C:/Program Files/dotnet/dotnet.exe" -targetargs:test -filter:"+[UnitTestTargetProject*]* -[MyUnitTests*]*" -output:".\MyProject_coverage.xml" -oldstyle

@larzw

larzw commented Nov 29, 2017

Copy link
Copy Markdown
Contributor

Thanks @jahav!

@larzw larzw merged commit 0255394 into codecov:master Nov 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants