I am facing following issues with Code coverage:
- The detailed html files are not generated for .cpp files which have .gcno and .gcda counterparts.
- gcda files automatically got deleted after running gcovr command.
I followed following steps :
- .gcno were generated when i compiled my code with -fprofile-arcs -ftest-coverage options and linked with -lgcov option.
- I ran the executable to generate the .gcda files.
- I copied .gcno and .gcda files to the location where i have my source code.
- I ran the gcovr command (mentioned below) from the top directory which have sub-directories which further contains .cpp files.
- The coverage.html is generated, which have information about other html reports, but when i open them they are blank.
- I have tried the gcovr running at various locations, like from root directory or from sub-directories.
Directory where ,gcno and .gcda files are present is :: D:\RTC_Latest_GTEST\RTC_21_11_18\software\output_gtest\Application\contents\Application_name
Directory from where gcovr command executed is :: D:\RTC_Latest_GTEST\RTC_21_11_18\software\Application\contents\Application_name
Currently i am running gcovr command from Application_name folder.
I ran the following command to generate the in depth html reports for my code :
python.exe c:\\Python27\\gcovr --exclude-unreachable-branches -b -r . -d --html --html-details -o coverage.html
Expected Results:
- Actual results would have the detailed coverage report in html format for each .cpp file which have corresponding .gcda and .gcno counterpart.
- .gcda and .gcno files would be present in the sub-directories after running gcovr command.
-d
option. Similarly, the use of the-b
option is unnecessary because that only affects the (default) textual report, not the HTML report. – amon