I have been trying to get code coverage working for Qt but im struggling with generating any coverage information
- Project
example.pro (contains include for googletest.pri)- gtest_dependency (contains googletest.pri
- headerfiles for gtest
testsuite.h
sourcefiles for gtest
test.cpp
testsuite.cpp
- headerfiles for gtest
- main.cpp
All files above are pretty much empty just the code to run the test and one test case.
- gtest_dependency (contains googletest.pri
I included the linker flags in the example.pro
QMAKE_CXXFLAGS += -O0 -g --coverage
QMAKE_LFLAGS += -O0 -g --coverage
The problem is when I build the project it creates all the .gcna .gcno files, but when i execute lcov it says
WARNING: no .gcda files found in ./coverage -skipping!
Finished .info-file creation
Reading tracefile ./coverage/coverage.info
lcov: ERROR: no valid records found in tracefile ./coverage/coverage.info
Reading data file ./coverage/coverage-filtered.info
genhtml: ERROR: cannot read file ./coverage/coverage-filtered.info
Qt Version 5.14.2
Compiler mingw730_64
lcov version 1.14
gcov version 7.5.0