How to get CodeCoverage of tests running on VS2017 Professional Version 15.9.8? - visual-studio-2017

I want to find code coverage for methods in dlls to be tested.
Through https://learn.microsoft.com/en-us/visualstudio/test/using-code-coverage-to-determine-how-much-code-is-being-tested?view=vs-2017#requirements I understand that there should be menu for CodeCoverage in Test Explorer for VS2017. which I didin't find for my installed visual studio..
So what is process to find code coverage for VS 2017 professional version 15.8

Code coverage is a Enterprise feature that is not available for Professional version.
Duplicate of question "Analyze Code Coverage" option missing in Visual Studio 2017 Professional
See version feature comparison here https://visualstudio.microsoft.com/vs/compare/

Related

Code Coverage for Visual Studio 2017 Community with C++

Are there any plugins for visual studio 2017 which enable to calculate unit test code coverage with C++?
I only found
OpenCppCoverage:
https://marketplace.visualstudio.com/items?itemName=OpenCppCoverage.OpenCppCoveragePlugin
but it seems to be outdated / not working.
Other than that it seems like there are only Code coverage plugins for .Net-Languages but not C++
Are there any other options (besides upgrading to MSVC Enterprise)
I recently tested CPPCoverage, an open source and free extension that works perfectly to perform code coverage of native Visual C++ unit tests.
It is a visual extension (VSIX) and provide details reports. Once installed, Right-click in solution explorer on the test or application project and click "Run code coverage".

Unit tests failing in Visual Studio 2017

I recently "upgraded" from Visual Studio 2012 to 2017, and now a number of tests which pass when run in 2012, fail in 2017. Application-specific Assertions fail and I am also getting the following exceptions:
Microsoft.QualityTools.Testing.Fakes.UnitTestIsolation.UnitTestIsolationException: UnitTestIsolation instrumentation failed to initialize. Please restart Visual Studio and rerun this test (needless to say, a restart does not resolve the issue)
System.InvalidOperationException: Operation is not valid due to the current state of the object.
All code, options, and settings are identical in both environments. I am using Microsoft's testing framework, not NUnit, XUnit, etc. The code is in VB.Net. Any guidance would be appreciated. Thanks.
The option to use Fakes Assemblies isn't available in the Professional version. We will need to upgrade to the Enterprise Edition, or continue using 2012.

Code Coverage Reporting with Visual Studio 2013 Professional for native C++

Using the C++ unit testing framework with Visual Studio 2013 Professional, one can write unit tests and run them from within the IDE, but in order to generate any coverage reports, apparently, one needs to have the Premium or Ultimate edition of Visual Studio.
Is it possible to get code coverage reports with the Professional edition, preferably without installing any third party tools? If not, what alternate options exist for people who are not using the more expensive editions of the IDE?
Please note that it's possible to generate the coverage data by using command line tools, but I am unable to find a way to look at the results. For the sake of reference, here are the steps for command line generation of the coverage statistics:
Build the code to test with with /PROFILE linker switch
Run vsinstr /coverage <binaryName> to instrument the code; make sure that you are inside VS 2013 command prompt
Run start vsperfmon -coverage -output:results to run the profiler
Run your unit tests
Stop the profiler by running vsperfcmd -shutdown
The above will give you a results.coverage file, with no way to view it without the Premium or Ultimate editions as far as I know.
With VS2013 Professional you are out of luck if you want to do it without third party tools Requirements: Visual Studio Ultimate, Visual Studio Premium (http://msdn.microsoft.com/en-us/library/dd537628.aspx). From what I understand you already managed to generate your *.coverage file and you are having problems opening it. Visual Coverage (https://github.com/jsargiot/visual-coverage) tool can help you with that, its very simple to use and it is opensource. If you would like to find more alternatives, see another SO thread: Viewing Code Coverage Results outside of Visual studio. The tools are meant for C# coverage files but from what I understand there should not be any difference.
If you are ready to use third-party libraries, you can use OpenCPPCoverage. It works for me like a command line app. But I couldn't run it like a visual studio plugin at Professional Visual Studio 2013.
One possible way you could get coverage data is by running an instrumentation toolkit on your Unit Test program. The instrumentation tool will tell you how much was covered during execution and you can easily relate this data back to how much coverage your unit tests give you. I did this with an XCode project and OpenPAT but you could do the same with any Visual Studio friendly toolkit.

How do I set up code coverage in C++ googletest project in Visual Studio 2010

I have a C++ googletest project building in Visual Studio 2010 professional. This builds a console application which generates XML test result output. How can I set it up to get code coverage information?
I have tried instructions here to instrument the code but viewing the Code Coverage results seems to require Visual Studio Ultimate. Is there any converter for the .coverage files Visual Studio generates?
Bonus points for portable/free/open-source solutions!
You can try OpenCppCoverage: http://opencppcoverage.codeplex.com.
OpenCppCoverage is a code coverage tools for C++ under Windows. It is open-source and works well with google test / Visual Studio C++.
Disclaimer: I am the author of this tool.
Hope that help.
Edit to follow brasofilo advice:
To be more precise about your question, OpenCppCoverage should work with Visual Studio C++ 2010 professional. The only requirement is to support native Pdb files (http://msdn.microsoft.com/en-us/library/yd4f8bd1%28vs.71%29.aspx).
It is open source and free and you can find sources here: https://opencppcoverage.codeplex.com/SourceControl/latest.
What do you mean by portable?
If you mean "Multi platform" -> No, it works only on Windows
If you mean "Portable application" (http://en.wikipedia.org/wiki/Portable_application): OpenCppCoverage required only Redistributable for Visual Studio 2013 to be installed on host (http://www.microsoft.com/en-US/download/details.aspx?id=40784) but it does not write to registry and you can move the binaries where you want (usb key for example).
Hope that help.
I think you can use the VSTEST.Consol.exe for this purpose http://msdn.microsoft.com/en-us/library/vstudio/jj155796.aspx.
According to documentation, it would run tests written against any test framework. You may enable the
/Enablecodecoverage option, which Enables data diagnostic adapter CodeCoverage in the test run.
More information may be found here: http://blogs.msdn.com/b/bhuvaneshwari/archive/2012/06/16/vstest-console-exe-commandline-test-runner.aspx
There is also an open source code coverage tool called ggcov: http://ggcov.sourceforge.net/index.html
Hope that these helps.

Profiling in Visual Studio 2008 PRO

How do I use the profiler in Visual Studio 2008?
I know theres a build option in Config Properties -> Linker -> Advanced -> Profile (/PROFILE), however I can't find anything about actauly using it, only articles I was able to find appear to only apply to older versions of Visual Studio (eg most say to goto Build->Profile to bring up the profile dialog box, yet in 2008 there is no such menu item).
Is this because Visual Studio 2008 does not include a profiler, and if it does where is it and where is the documentation for it?
Microsoft has released stand-alone Profiler for VS 2008 here
The profiler is only available in the Team System editions of Visual Studio 2008. The last version that I used that included a profiler was Visual C++ 6.0.
For Visual Studio 2005, you could try Compuware DevPartner Performance Analysis Community Edition.
There was also a list of .NET profilers in the What Are Some Good .NET Profilers question.
As I understood from reading a few sites, when you use VS 2008 stand alone profiler to create .vsp files, you will need either VS2008 Premium or Ultimate to view .vsp files.
By the way, I installed VS2012 Release candidate which is available for free (trial version?) and I can use its profiling engine.