Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generating empty .gcda files

Tags:

lcov

gcov

I use gcov for doing code coverage analysis with lcov for generating graphical output of coverage. This works well for code file where atleast some part of object file has been executed. I want to be able to track files which have not been executed at all. I suspect this has to do with .gcda files not being generated for these files. Is there a way to force the generation of .gcda file for all object files irrespective of execution?

like image 279
mnair4 Avatar asked May 28 '14 22:05

mnair4


1 Answers

The procedure to do this is outlined here:

http://linux.die.net/man/1/lcov

Recommended procedure when capturing data for a test case:

  1. create baseline coverage data file

    lcov -c -i -d appdir -o app_base.info

  2. perform test

    appdir/test

  3. create test coverage data file

    lcov -c -d appdir -o app_test.info

  4. combine baseline and test coverage data

    lcov -a app_base.info -a app_test.info -o app_total.info

like image 122
konradsa Avatar answered Jan 25 '23 10:01

konradsa