I run the OpenCPPCoverage with following scenario:
The program I run is a Test suite which has say 3 Tests:
This program loads the module DLL for which I want the code coverage. Say the module has a CXX file with 3 APIs:
The TestA covers the FunctA(), TestB covers the FunctB() and TestC covers all three functions.
How can I generate this mapping of which test covers which API?
FunctA : TestA
FunctB : TestB
FunctC : TestA,TestB,TestC
I understand that the OpenCPPCoverage does line coverage. However, is it possible to enhance the OpenCPPCoverage to generate such mapping file? If it is possible, I can think of doing such enhancement.
Nov 14, 2016 at 11:44 AM
Now, the only solution is to run the 3 test cases one by one.
It should be possible to store the location of the first caller for each line.
Storing multiple callers is equivalent to count the number of times a line is executed. I am afraid this will slow down a lot the covered application.
Anyway, this is an interesting feature but I already have a lot of things planned. Perhaps I will work on it after.
You can try to do it yourself but it is not easy to compile OpenCppCoverage (One thing I plan to work on). You can check CodeCoverageRunner::OnBreakPoint. This function is called the first time a line is executed.
I hope this will help,