1

My project is integrated with GTest Unit Test Framework and Gcov and Lcov Coverage tool is used generate Code Coverage report. The Coverage report was generating fine with QT version 5.9.1 and MingW compiler (mingw530_32).

The same project has been migrated to later version of QT i.e. 5.15.2 and the MingW compiler is (mingw810_32), with this later version of software the Lcov is unable to generate the Code coverage report. The coverage.info file is generated with "TN:" field empty.

Few project details:

  1. The project is built in windows environment.
  2. The Project .pro file is added with the below options to generate .gcda and .gcno files:
QMAKE_CXXFLAGS += -g -Wall -fprofile-arcs -ftest-coverage  -O2 -ftest-coverage --coverage
QMAKE_LFLAGS += -g -Wall -fprofile-arcs -ftest-coverage  -O2

LIBS += \
    -lgcov 
  1. For Lcov the modified lcov.perl and genhtml.perl is used to generate the report

Issue: The .gc* files are getting generated with the above setup but the Lcov tool is failing to generate propert .info file wherein the previous MingW compiler works fine.

I raised the same query in QT portal they suggested me to use "gcov intermediate text format" instead of .gcda and .gcno files.

From QT portal: 
"As being developer of GCOV in GCC, I would recommend to use intermediate format (-i) of gcov tool instead of reading of *.gc{da,no} files. Thanks for understanding."
Can you please give the intermediate format a try?
I hope it helps!

My query is: How to generate these intermediate files of gcov ? I googled about this and they say to use -i option, but I am not sure where exactly to use this option. Do we need to add -i option in the .pro file (I tried that but getting unrecognized command line option) Do we need to add -i option while running lcov.perl file ? ( Even tried this but no impact on the report)

Do let me know how to generate the intermediate gcov file and how lcov can use those gcov files to generate the code coverage report.

Thanks in advance for your support.

Bharathi
  • 337
  • 1
  • 5
  • 17

0 Answers0