I can run a coverage check using cmake following this wiki page. This is very simple and a setting a dashboard I can have a nice view of code coverage on my browser (latter part). But I don't want to ctest everytime just to check the progress of a single file. In fact, I want to check code coverage locally for a subdirectoy rather than enitre library with thirdparty code.
So, how can we check the code coverage for a subdirectory. Of course, I had a written a test in cmakelists.txt using add_test(....).
I will try to explain a little bit without any code.
Class A {
public:
A() {}
....
so many methods ..
....
protected:
~A() {}
}; //end class A
Next I've written a test:
//testA
int main()
{
A *a = new A();
a->method1();
a->method2();
...
}
Now in CMakeLists.txt, I have:
add_test(testA ...)
So when I run ctest it will run all test including TestA
. Of course, I can use ctest -R "TestA"
.
Now coming back to the question, how can I check coverage of class A
only. without running all test or just running only testA
?