Search code examples
c++macosllvmcode-coveragegcov

Missing certain GCDA files after test execution


I'm currently facing an issue with generating .gcda files for coverage data of a static library. I can get coverage data for most files, but not all.

I'll refer to the object file with the missing coverage data as X.

Some things to note:

  • I have compiled the library and test executable with the appropriate flags.
  • The .gcno files are generated for all objects, including X.
  • The .gcda files are generated for MOST objects, excepting X.
  • The symbol dump of X's object file has the gcov symbols present in its disassembly.

When running a test that uses X, .gcda files are generated for other files, just not X.

What could be happening that prevents a single .gcda file from being generated?

-

Operating System: OS X 10.12

LLVM Compiler Version: 8.0.0


Solution

  • It appears that the issue was including the suspect files in both the test project and the library project. The .gcda files were found in the test's intermediate files, but were absent from the library's intermediate files.

    Strange issue, and also difficult to debug.