You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Coverage is generated using [OpenCover](https://github.com/OpenCover/opencover). You can obtain it from [NuGet](https://www.nuget.org/packages/opencover) or [Chocolatey](https://chocolatey.org/packages/opencover.portable). If we run the following command in PowerShell to install OpenCover via Chocolatey,
16
27
17
28
```powershell
@@ -22,9 +33,9 @@ the OpenCover commandline will become available.
22
33
23
34
Generation of coverage report is slighly different depending on the .NET platform of your test projects.
24
35
25
-
### .NET Framework project
36
+
####.NET Framework project
26
37
27
-
#### xUnit
38
+
#####xUnit
28
39
29
40
First install the xUnit console runner via [Nuget](https://www.nuget.org/packages/xunit.runner.console/2.3.0-beta1-build3642) or [Chocolatey](https://chocolatey.org/packages/XUnit). If we run the following in PowerShell to install xUnit via Chocolatey
where `-oldstyle` switch is necessary, because .NET Core uses `System.Private.CoreLib` instead of `mscorlib` and thus `OpenCover` can't use `mscorlib` for code instrumentation. You may also need to change the location of `dotnet.exe` to depending on the installed location.
75
86
76
-
## Uploading Report
77
-
78
-
Many options exist for uploading reports to Codecov. Three commonly used uploaders for .NET are
For OS X and Linux builds, the recommended uploader is bash. For windows builds, all three uploaders work, but Codecov-exe does not require any dependencies. For example, the bash uploader and python uploader would require bash or python to be installed. This may or may not be an option.
85
-
86
-
### Codecov-exe
87
-
88
-
First install Codecov-exe via [Nuget](https://www.nuget.org/packages/Codecov/) or [Chocolatey](https://chocolatey.org/packages/codecov). If we run the following in PowerShell to install it via Chocolatey
The previous examples assumed local development. More commonly, you'll use a CI service like [AppVeyor](https://www.appveyor.com/) or [TeamCity](https://www.jetbrains.com/teamcity/). For TeamCity builds please see the [documentation](https://github.com/codecov/codecov-exe#teamcity). For AppVeyor builds using xUnit, your yaml file would look something like
If you use [Cake](http://cakebuild.net/) (C# Make) for your build automation, there is a [Cake.Codecov](http://cakebuild.net/dsl/codecov/) addin available. Cake also has built in support for [OpenCover](http://cakebuild.net/dsl/opencover/). It makes using OpenCover and Codecov-exe really easy!
192
-
193
-
## Sample Project
194
-
195
-
An example C# project using AppVeyor, xUnit, OpenCover, and Codecov-exe is [DotNetAnalyzers/StyleCopAnalyzers](https://github.com/DotNetAnalyzers/StyleCopAnalyzers).
138
+
## Caveats
139
+
### Private Repo
140
+
Repository tokens are required for (a) all private repos, (b) public repos not using Travis-CI, CircleCI, GitHub Actions, or AppVeyor. Find your repository token at Codecov and provide via appending `-t <your upload token>` to you where you upload reports e.g. `.\codecov -f "MyProject_coverage.xml" -t <your upload token>`
196
141
197
-
We are happy to help if you have any questions. Please contact email our Support at [support@codecov.io](mailto:support@codecov.io)
0 commit comments