Questions tagged [opencover]

OpenCover is a code coverage tool for .NET and currently supports .NET 2, 3 and 4

OpenCover is a new attempt to build a code coverage utility to try and address some of the issues that have been encountered whilst maintaining PartCover.

The main aims of this project are:

  • Provide 32 and 64 bit support for .NET2 and .NET4
  • Better generics handling, though PartCover has been upgraded to handle .NET4 and generics (in both .NET2 and 4) it isn't pretty.
  • Simpler coverage handling
  • Better test support - the ultimate aim is to use the information to show what tests currently cover the code being worked on i.e. would it be possible to run those tests first and then the rest of the tests to provide faster feedback during development.
266 questions
0
votes
1 answer

Use OpenCover in .gitlab-ci.yaml

I have install OpenCover and Report Generator nuget, but do not know how to trigger run OpenCover in .gitlab-ci.yaml to run testing for getting the code coverage.
Gary
  • 1
0
votes
0 answers

How to use OpenCover for XUnit Test Coverage?

I would like to integrate OpenCover for XUnit test coverage to my Visual Studio project. I made a little example project just for testing the integration. My example solution OpenCoverProject has two projects. One XUnit project UnitTests with a…
MarcoBot
  • 21
  • 6
0
votes
1 answer

Trouble excluding classes from OpenCover code coverage report using Visual Studio 2019 Pro's ExcludeFromCodeCoverageAttribute

I am using Visual Studio 2019 Professional. For about a year and a half, I've been regularly producing code coverage reports by running a batch file that calls OpenCover to run the analysis and then runs ReportGenerator to process the data into a…
DaveyBoy
  • 435
  • 4
  • 20
0
votes
1 answer

MSBuild get assembly names of tests

I'm working on generating coverage. One of the tests was taking a long time if the OpenCover filter was just +[*] so I've decided to add the assembly names. But this isn't an efficient approach as the assemblies may increase. I want to do something…
0
votes
0 answers

OpenCover under the hood

I use OpenCover and it works fine for most of the cases. But I have one case when it doesn't understand that some piece of code is in use by tests. The case is when I execute something using Assembly.Load(). Something like this var assembly =…
Serg046
  • 1,043
  • 1
  • 13
  • 42
0
votes
1 answer

Opencover branch percentage always 0

I am working on Visual studio 2019 solution in C#, and i try to do the code coverage. It seems to be everything ok, but Branch coverage is always 0%. However it is possible to see that many branches are anywas visited. Someone with same problem?…
mbvr46
  • 21
  • 1
0
votes
1 answer

Using Nunit3-Console.exe to run specflow tests but detects tests from only one namespace

Build Environment project language: C# .net framework 4.5 OpenCover version 2.5.3427 Specflow version 2.3 Nunit version 3.11.0 Requirement During build the user will select multiple subsystems acceptance tests and i need to run tests for those…
Ganapatsa
  • 21
  • 4
0
votes
1 answer

How to write batch file for OpenCover for MSTest with relative paths, so that it will become machine independent?

I am using below format for running OpenCover code coverage for MSTest from cmd: C:\> \Your\OpenCover\Path\OpenCover.Console.exe -target:"\Your\Path\Here\MSTest.exe" -targetargs:"/testcontainer:\Your\DLL\Path\bin\Debug\TestProject.dll"…
0
votes
1 answer

How to connect OpenCover to VS tests

OpenCover 4.7.922 installed in VS 2015 Community, and appears in VS menu bar, but the link to my Tests is broken. Project is a C# console app. This was working a while ago, with the same project. Possibly disturbed by (1) installing VS 2019 (Now…
Art
  • 109
  • 3
  • 8
0
votes
1 answer

HttpParameterBinding without code coverage

OpenCover On Cake script does not detect coverage on my Owin.Testing usage applying HttpPArameterBiding to some ApiController action parameter. I have Created a new type of my ApiController that as an action with my ParameterBindingAttribute that I…
0
votes
0 answers

OpenCover not finding PDBs on the build server

I have the following command on my local machine: C:\Tools\opencover\OpenCover.Console.exe -register -target:C:\local-source\develop\Lib\NuGetPackages\xunit.runner.console.2.4.0\tools\net462\xunit.console.exe …
Vin Shahrdar
  • 1,151
  • 1
  • 12
  • 30
0
votes
1 answer

OpenCover C# Branch Coverage says there should be a branch on throw new Exception

I'm parsing a date and throwing an exception. Aside from verifying an invalid date format throws an exception, I'm not sure what other branch to hit. I did try Exception vs ArgumentException, both had the same result. I am pretty new to unit test…
bgraham
  • 1,939
  • 1
  • 10
  • 17
0
votes
0 answers

Opencover - No results with NUnit3 from command line

I am trying to get the code coverage with Opencover but I am getting below output always. My batch files contents are like: "..packages\OpenCover.4.6.519\tools\OpenCover.Console.exe" ^ -register:user…
Parashuram
  • 1,498
  • 2
  • 16
  • 36
0
votes
0 answers

Writing a filter in Opencover to include only one assembly

I am using OpenCover to analyse the code coverage of my project. I am using MSTest to write UNIT Tests. I want to analyze the code coverage of a particular assembly and only that assembly.I want to write a filter the same. Basically the filter…
SriChakra
  • 39
  • 1
  • 8
0
votes
1 answer

What I need to Compile and Debug OpenCover solution?

I'm using OpenCover (https://github.com/OpenCover/opencover) for code coverage and it has a bug of AccessViolationException. I already opened an issue for the problem but I want to solve it by myself. The problem is that I even cannot compile it in…
JonesOne
  • 11
  • 3