I want to generate coverage reports using gcov and lcov.
What I have done so far : -
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 eo location. 4. When I execute binary, it is resulting into .gcda files.
What do I need to do : -
I have to use these data files (.gcda) and want to create a clean report using lcov.
Problem : -
There are several directories in which there are source files and inside each directory I create dir obj / ARCH to store object files.
Therefore, the final directory structure will 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 run lcov from the proto level and it finds .gcda files but gives some error in finding .h and .C files. Any idea how to make this process 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.
source share