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
2
votes
2 answers

Running XUnit and FluentAssertions with OpenCover gives error message

I am trying to run code coverage with Xunit and Fluent Assertions on ASP.NET Core. However, I am getting an error message which I don't really understand. My project.json of the test project: { "version": "1.0.0-*", "testRunner": "xunit", …
Stefan
  • 1,590
  • 3
  • 18
  • 33
2
votes
1 answer

Sonarqube coverage with opencover and Nunit

We are currently using Sonarqube 4.5.7 (SonarQube Scanner for MSBuild 2.1) with Nunit and Opencover. Test execution is successful and metrics correctly reported in dashboard. But coverage section in Sonar dashboard is blank and coverage xml shows…
Coc
  • 437
  • 1
  • 3
  • 19
2
votes
1 answer

SonarQube : nUnit's results are not displayed

I'm using SonarQube and Jenkins. In Jenkins, I check the unit tests with nUnit and the coverage with opencover. The opencover's report is displayed in Sonar but the nunit's report is not. The Unit Tests count is not even displayed in the home page…
jBravo
  • 873
  • 1
  • 9
  • 28
2
votes
1 answer

Getting coverage using OpenCover for Selenium tests

The background: We have a project starting a service that gets controlled from the web interface GUI. We're not using a specific (from a commercial point of view) web server, but an in-house created wrapper around the windows service that manages…
Cosmin
  • 2,354
  • 2
  • 22
  • 39
2
votes
1 answer

OpenCover version 4.6.519 throwing System.InvalidProgramException : Common Language Runtime detected an invalid program

Environment: C# 6 .NET Framework 4.6.1 NUnit Console 2.6.3 I am running the following command to create test coverage on my build: "C:\Program Files (x86)\OpenCover.4.6.519\OpenCover.Console.exe" -target:"C:\Program Files (x86)\NUnit…
BNM22
  • 31
  • 4
2
votes
1 answer

Merge InspectCode (Resharper) and OpenCover code coverage report into Sonar Qube Build

We are using InspectCode- Resharper plugin for generating C# code analysis report and Opencover for Code coverage report (unit test cases). These are the two commands runs one after an another in the Teamcity. When we generate the Resharper analysis…
codebased
  • 6,945
  • 9
  • 50
  • 84
2
votes
1 answer

How to improve OpenCover performance when I need only basic coverage data?

I need to run OpenCover against a battery of 1000+ tests. I am interested only in: % of lines covered Which lines are covered and which are not I don't need: Visit count Number of CPU cycles / real execution time Any performance report From the…
2
votes
2 answers

Doesnt find MSBuild.SonarQube.Internal.PostProcess.exe

Unable to execute sonar run for ms build when i change the sonar host from localhost to my machine ip. tried changing the host in sonar.properties file and also in…
divakar.scm
  • 1,256
  • 5
  • 21
  • 32
2
votes
1 answer

OpenCover: Unable to run coverage for more than 2 assemblies

I am trying to use OpenCover With XUnit and MSBuild for our project and it works fine with one or two assemblies. But when the number of assemblies goes more than 2 it throws the below error: EXEC : error : unknown command line option:…
Vinoth
  • 2,419
  • 2
  • 19
  • 34
2
votes
1 answer

OpenCover coverage for NUnit test

I am trying to run code coverage using Opencover for NUnit test cases. I am getting results as expected, but the problem is while executing opencover it is again running the tests. We don't want this to be happen as we are running the tests…
Dinesh
  • 117
  • 3
  • 9
2
votes
2 answers

Open Cover filters how to avoid test assembly files from code coverage

I have gone through the Opencover wiki documentation and tried a lot to figure out what would be the filter criteria for not to include test assembly as part of code coverage. Here is the problem for eg I have many assemblies starts with sample…
2
votes
1 answer

OpenCover & ReportGenerator : How to generate one html report from xml file

I have generated xml file using OpenCover. And used below command to generate html report, "C:\ReportGenerator_2.1.4.0\bin\ReportGenerator.exe" -reports:"Reports\Test.xml" -targetdir:"Reports" It generated multiple html reports under 'Reports'…
magg
  • 119
  • 1
  • 3
  • 11
2
votes
2 answers

Can I execute OpenCover on existing test result files?

As part of the TFS Build we execute tests that generate trx files. I would like to execute on these set of files code coverage analysis using OpenCover, without re-executing the Unit Tests. Is there a way to do so? Thanks
Arieltk
  • 121
  • 2
  • 9
2
votes
1 answer

Running Fakes with 3rd party coverage tools

Is it possible to use Microsoft Fakes with 3rd party code-coverage tools such as NCover, PartCover or OpenCover? With Moles this was possible using the CLRMONITOR_EXTERNAL_PROFILERS environment variable but it doesn't work with Fakes so I was…
Shaun Wilde
  • 8,228
  • 4
  • 36
  • 56
2
votes
1 answer

How OpenCoverage coverage works - are classes without any tests counted?

I think I have a basic misunderstanding of the way OpenCover (or coverage in general) is working. I think that classes without any tests are not counted in the coverage, which is very strange. for example, if I have two classes (lets say of the same…
roybj
  • 278
  • 3
  • 14