mweibel / lcov-result-merger

Merges multiple lcov results into one
MIT License
102 stars 22 forks source link

Function coverage is lost when merging multiple results #31

Closed gstemp closed 7 years ago

gstemp commented 7 years ago

Using lcov-result-merger (1.2.0) to combine coverage reports from targets running the same binary, the report loses the function coverage that can be seen in the individual report generated from each target separately.

My workflow was as follows:

  1. Build binary on build-machine
  2. Copy the build tree (with .gcno files) to target1 and target2
  3. Run program on each target
  4. Run lcov -d . -c --to-package coverage_target1 on target1
  5. Run lcov -d . -c --to-package coverage_target2 on target2
  6. Copy coverage_target1 and coverage_target2 to build-machine
  7. Run lcov --from-package on the copied files (creating target1.info and target2.info)
  8. Run lcov-result-merger on the two .info files, creating merged.info
  9. Run genhtml on target1.info, target2.info, and merged.info

genhtml summary on target1.info:

Writing directory view page.
Overall coverage rate:
  lines......: 23.6% (6883 of 29121 lines)
  functions..: 19.9% (1537 of 7724 functions)

genhtml summary on target2.info:

Writing directory view page.
Overall coverage rate:
  lines......: 36.2% (10549 of 29121 lines)
  functions..: 25.0% (1929 of 7724 functions)

genhtml summary on merged.info (output of lcov-result-merger):

Writing directory view page.
Overall coverage rate:
  lines......: 39.1% (11398 of 29121 lines)
  functions..: no data found

Note that the function coverage is missing from the merged result.

mweibel commented 7 years ago

Can you provide me an example file(s) which I could use to test that? I assume it could be related to #14 but I'm not sure

mweibel commented 7 years ago

@gstemp any update?

gstemp commented 7 years ago

I can't share the proprietary project where this occurred, and I haven't had time to try to create a "sample" project with this behavior. So let's close this issue and I'll reopen at a later date if needed. Thanks.