1

I have gcov files created for 2 versions of the same file (old & latest).

Need to add the coverage counters for the lines that are present in both the files and generate a new gcov file with cumulative coverage.

I tried to use the diff tool to get the unchanged line numbers and add the coverage counters for these lines

Is there some tool available or please suggest some approaches.

MSK
  • 175
  • 1
  • 10
  • I doubt you can sensibly merge these. They are coverage data for two different programs, even if you think they are the same program. So a probe at one point in one program corresponds to which probe in the second one? If you invert the condition on an IF, and swap the THEN and ELSE clauses (so you get an functionally equivalent program), how would a tool know that coverage counters for the THEN clause correspond to the new ELSE clause? – Ira Baxter Dec 03 '16 at 12:02
  • I agree, maynot be able to cover all the cases. but is it possible to add the coverage numbers for just the lines that are same in the both the files and created a new gcov file (with cumulative coverage numbers). Wanted to know some best ways to achieve this (if it is possible) – MSK Dec 03 '16 at 12:18
  • You would be better off using something like our Smart Differencer (see http://www.semdesigns.com/Products/SmartDifferencer/) to track how code has been shuffled around from the original to the target file, and using the shuffle information to "line up" the probes. – Ira Baxter Dec 03 '16 at 12:34
  • This is good, But, would need a similar open source version on Linux – MSK Dec 04 '16 at 15:23
  • No open source version of Smart Differencer available. It is a native Windows product. However, we have extensively test it with Wine, and packaged the product with .sh script so it runs as if it were a native program under Linux. – Ira Baxter Dec 04 '16 at 20:39

0 Answers0