How to get Code Coverage in Visual Studio 2022 with CMake Cpp Projects with a Windows Compiler
I have a Cpp project that is being built with the MSVC compiler and using CMake. I need a code coverage solution, preferably one that either provides detailed reports or in Visual Studio code highlighting that is possible using CMake.
So far I have tried using a Linux compiler and GCOVR/GCC to create these reports, but I am looking for a solution for a Windows compiler, so cannot use the GCC compiler flags.
This need to be able to work in not just Visual Studio Enterprise as the current suggestion requires: https://learn.microsoft.com/en-us/visualstudio/test/using-code-coverage-to-determine-how-much-code-is-being-tested?view=vs-2022&tabs=csharp#use-code-coverage-to-determine-how-much-code-is-being-tested