Skip to content
This repository has been archived by the owner on Dec 5, 2022. It is now read-only.

How to do code coverage for a CMake/CTest project with VSTest.Console.exe? #189

Open
LeslieGerman opened this issue May 28, 2019 · 1 comment

Comments

@LeslieGerman
Copy link

I have a CMake based C++ app with some CTests.
Test coverage tool works fine (almost) from inside VS Enterprise. The Test Explorer discovers the defined CTests and the Coverage Tool runs them and creates a report.

How can I run the test coverage over the available CTests from command line?
I guess VSTest.Console.exe should be used, but not clear how.
Can you please provide information about it?

Thanks and regards.

@Hilarius86
Copy link

You can run VSTest with a runsettings file and add a DataCollector for CodeCoverage
https://docs.microsoft.com/de-de/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file?view=vs-2017#diagnostic-data-adapters-data-collectors
That's a solution?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants