0

I am trying to get the code coverage for the C# test project(Nunit test case) Using OpenCover for sonarqube analysis. I ran the Following Executing cmd in command prompt(from the C# project solution folder & From C# project folder) but always i am getting the below executon output. I got the executing command from sonar page.

Is there anything i done wrongly or should i need to add any more argument to get the report.

System & Software Details:

  • OS: Windows7 64 bit
  • MsBuild Version: 14
  • Visual Studio : VS2015
  • Opencover version: 4.6.166.0
  • Nunit Version: 2.4.8.0 (Only having the Nunit core, Nunit framework & Nunit core interfaces library dll's)
  • SonarQube version: 5.6.5
  • SonarC# version: 5.10.0.1411
  • Sonar scanner for MSBuild Version: 2.2.0.24

Executing cmd : "C:\Program Files (x86)\OpenCover\OpenCover.Console.exe" -output:"SolutionFolder.sonarqube\opencover.xml" -register:user -target:"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" -targetargs:"SolutionFolder\UnitTestProject1\bin\Debug\UnitTestProject1.dll"

Execution Output: Executing: C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe Microsoft (R) Test Execution Command Line Tool Version 14.0.25420.1 Copyright (c) Microsoft Corporation. All rights reserved. Starting test execution, please wait... Warning: Using Isolation mode to run tests as required by effective Platform:X86 and .Net Framework:Framework35 settings for test run. Use the /inIsolation parameter to suppress this warning. Warning: No test is available in SolutionFolder\UnitTestProject1\bin\Debug\UnitTestProject1.dll. Make sure that installed test discoverers & executors, platform & framework version settings are appropriate and try again. Information: Additionally, you can try specifying '/UseVsixExtensions' command if the test discoverer & executor is installed on the machine as vsix extensions and your installation supports vsix extensions. Example: vstest.console.exe myTests.dll /UseVsixExtensions:true Committing... Visited Classes 0 of 1 (0) Visited Methods 0 of 22 (0) Visited Points 0 of 117 (0) Visited Branches 0 of 22 (0) ==== Alternative Results (includes all methods including those without corresponding source) ==== Alternative Visited Classes 0 of 1 (0) Alternative Visited Methods 0 of 23 (0)

Note: In the Coverage output report, am only getting zero percentage coverage.

Community
  • 1
  • 1
user7014262
  • 135
  • 12
  • "Make sure that installed test discoverers & executors, platform & framework version settings are appropriate and try again" Your command-line says nothing about using the NUnit test adapter. – Charlie May 19 '17 at 14:55
  • 1
    If you are not using VS coverage, why are you running vstest-console.exe? Just run the nunit console. – Charlie May 19 '17 at 14:57
  • @Charlie Thanks for your response... Previously I used the gallio(which has adapter for nunit, mstest & so...) gets the code coverage report, but it's fails when I build the code in VS2015 – user7014262 May 22 '17 at 02:32
  • Gallio could not able to parse the PDB file which is built in VS2015. Is there any open source tool like gallio to get the code coverage for all kind of test libraries discovers ... – user7014262 May 22 '17 at 02:43

0 Answers0