title: Generating test coverage of C++ static library as called by separate test classes
body: <p>I am using QT Creator to work on a medium-sized project in C++.</p>
  
  <p>The project structure basically looks like this</p>
  
  <ol>
  <li><p>Project</p>
  
  <ul>
  <li>Group A
  
  <ul>
  <li>Library A1</li>
  </ul></li>
  <li>Group B
  
  <ul>
  <li>Library B1</li>
  <li>Library B2</li>
  <li>...etc</li>
  </ul></li>
  <li><p>Test</p>
  
  <ul>
  <li>LibA1_Test</li>
  <li>LibB1_Test</li>
  <li>LibB2_Test</li>
  <li>...etc</li>
  </ul></li>
  </ul></li>
  </ol>
  
  <p>The libraries are tested by the executables in the test project. I've managed to compile the tests themselves with gcov enabled, and produce code coverage reports with lcov, but all that they were showing the coverage for were the test cases, not the actual code that I'm testing. I've also tried compiling the static libraries with gcov as well, but when I run the tests against those libraries it does not generate any of the gcov output files. </p>
  
  <p>How could I generate the gcov output files by linking my project libraries against the tests? I want to see if there are any gaps in my unit tests.</p>