Closed roopahtshree closed 8 months ago
Set RunMsCodeCoverage to Yes.
After setting RunMsCodeCoverage to Yes, i'm getting the below error. Please help to solve that error
Using automatically detected runsettings file(s). To learn more visit https://aka.ms/vs-runsettings. ========== Starting test run ========== Failed to negotiate protocol, waiting for response timed out after 90 seconds. This may occur due to machine slowness, please set environment variable VSTEST_CONNECTION_TIMEOUT to increase timeout. Failed to negotiate protocol, waiting for response timed out after 90 seconds. This may occur due to machine slowness, please set environment variable VSTEST_CONNECTION_TIMEOUT to increase timeout. ========== Test run aborted: 0 Tests (0 Passed, 0 Failed, 0 Skipped) run in < 1 ms ==========
@roopahtshree Did you resolve your issue ?
No, i tried setting the environment variable VSTEST_CONNECTION_TIMEOUT to 6000. Still the coverage is not getting generated
Can you post your generated run settings from directoty \Debug\fine-code-coverage\coverage-tool-output
Perhaps you can check this too https://learn.microsoft.com/en-us/visualstudio/test/troubleshooting-code-coverage?view=vs-2022
Can we use fine code coverage to generate a coverage for C project having cunit test framework?
Attached is the runsettings generated Sample-Test1-fcc-mscodecoverage-generated.txt
Can we use fine code coverage to generate a coverage for C project having cunit test framework?
I believe ms code coverage is C# or C++. Did you mean C++ ?
from https://learn.microsoft.com/en-us/visualstudio/test/writing-unit-tests-for-c-cpp?view=vs-2022 Visual Studio includes these C++ test frameworks with no additional downloads required:
Microsoft Unit Testing Framework for C++ Google Test Boost.Test CTest You can use the installed frameworks, or write your own test adapter for whatever framework you want to use within Visual Studio. A test adapter integrates unit tests with the Test Explorer window. Several third-party adapters are available on the Visual Studio Marketplace. For more information, see Install third-party unit test frameworks.
So cunit would need a test adapter.
Thanks for the information.
Currently i'm using google test framework for which i have attached runsettings earlier.
https://github.com/FortuneN/FineCodeCoverage/issues/219#issuecomment-1254636816
Hello, is it supporting branch coverage for C++, I tested it with VS2022 and the line coverage works well, but the branch coverage always shows 0.
Given that C++ worked for me ( admittedly on a very simple project ) and for the user above - closing as VSTEST_CONNECTION_TIMEOUT is a vstest issue and not FCC related.
I'm using Microsoft Visual Studio Professional 2019 Version 16.11.18 . i have created a simple google test project in c++. in the test explorer 1 test case is getting passed, but fine code coverage summary is showing all as 0
Below is the coverage log Generating html report Cobertura report generation duration - 00:00:00.8341873 Generating cobertura report Completed coverage for (Sample-Test1) : 00:00:04.9284836 Run OpenCover (Sample-Test1) File synchronization 7 items, duration : 00:00:00.0322093 Starting coverage - full details in FCC Output Pane Coverage collected when tests finish. RunInParallel option true for immediate See option RunMsCodeCoverage for a better (Beta) experience. View readme. Html report generation duration - 00:00:01.3744892 Generating html report Cobertura report generation duration - 00:00:00.9058176 Generating cobertura report Completed coverage for (Sample-Test1): 00:00:05.0150038 Run OpenCover (Sample-Test1) File synchronization 7 items, duration : 00:00:00.0394546 Starting coverage - full details in FCC Output Pane Coverage collected when tests finish. RunInParallel option true for immediate See option RunMsCodeCoverage for a better (Beta) experience. View readme. Html report generation duration - 00:00:01.7879862 Generating html report Cobertura report generation duration - 00:00:01.0141168 Generating cobertura report Completed coverage for (Sample-Test1) : 00:00:04.3797661 Run OpenCover (Sample-Test1) File synchronization 23 items, duration : 00:00:00.1191535 Starting coverage - full details in FCC Output Pan e Coverage collected when tests finish. RunInParallel option true for immediate See option RunMsCodeCoverage for a better (Beta) experience. View readme.