Gcov - lcov for multiple directories containing gcda files

De openkb
Aller à : Navigation, rechercher

Sommaire

Questions

I want to generate the coverage reports using gcov and lcov.

  What I have done till now   :-
1. I compiled my code using --fprofile-arcs and -fprofile-coverage in
g++.

2. I have linked using lcov.

3. I have .gcno files with th e.o location.

4. When I execute binary, it is resulting into .gcda files.
  What I have to do    :-

I have to use these data files (.gcda) and want to create a clean report using lcov.

  Problem    :-

There are multiple directories in which there are source files and inside each directory I am creating an obj/ARCH dir to keep the object files.

Hence the final directory structure would be:-

  proto  ----> MJ1 ----> MJ2 ----> MJ3 ----> MJ4 ----> MJ5

  MJ1 ----> .cpp 

      ----> obj/linux/*.o *.gcno *.gcda 

  MJ2 ----> .cpp 

      ----> obj/linux/*.o *.gcno *.gcda 

same with M3, M4, M5.

I am executing lcov from the proto level and it finds .gcda files but giving some error in finding .h and .C file. Any idea how to make this process path independent?

Error:-
../MjUtil/glob.h:cannot open source file
../MjUtil/MJError.h:cannot open source file
../MjUtil/OsStatisticsFile.h:cannot open source file

Thanks in advance.

Answers

Have you tried supplying the --base-directory . option to lcov ?

Source

License : cc by-sa 3.0

http://stackoverflow.com/questions/10601242/lcov-for-multiple-directories-containing-gcda-files

Related

Outils personnels
Espaces de noms

Variantes
Actions
Navigation
Outils