CMake and lcov: gcno files not found

I am trying to get the code in my project based on CMake (which consists of several goals).

First I generate gcno files with:

lcov -b . -d . -o coverage.output --capture --initial 

* .gcno generated in

 build_dir/[target_dir]/CMakeFiles/[target_dir].dir 

Then I run my tests that generate * .gcna files in

 build_dir/tests/CMakeFiles/[target_dir].dir 

When I started lcov again:

 lcov -b . -d . -o coverage.output --capture 

I get the following error:

 Scanning . for .gcda files ... Found 23 data files in . Processing Base.dir/DateTools.cpp.gcda geninfo: ERROR: build_gcov/tests/CMakeFiles/Base.dir/DateTools.cpp.gcno: could not open file 

When I manually move the * .gcno file to the directory where * .gcda is created, it works.

Thanks for the help!!!

+6
source share
1 answer

I figured out how to use lcov with CMake and link everything in the cmake module .

+5
source

Source: https://habr.com/ru/post/907252/


All Articles