Coverage per test case

May 27 at 11:05 PM

I would like to know if there is any way to generate code coverage per test case.
If not directly, is there any workaround apart from running each test case at a time?
May 28 at 9:30 AM

OpenCppCoverage does not know anything about the test cases and so it is not possible to do what you want.
If you use gtest, you could write a small script that call YOUR_UNIT_TESTS.exe --gtest_list_tests to get the list of tests.
For each test case, run the following command:
OpenCppCoverage.exe --source YOUR_SOURCE_FILTER -- YOUR_UNIT_TESTS.exe --gtest_filter=YOUR_TEST_CASE
I hope this will help,

May 29 at 11:47 PM
Thanks a lot for your help. Definitely helped me!
Marked as answer by OpenCppCoverage on 6/4/2017 at 1:49 PM