我尝试创建一份覆盖率报告。我用
make clean allmake coverage

我已经安装了Boost和lcov。但是,当我尝试make coverage时,它失败并显示以下错误消息:

Processing components/Project/CMakeFiles/ProjectMainController.dir/dataHandling/savingUnit/Trimmer.cpp.gcda
geninfo: ERROR: /home/user/ProjectFolder/Project/build/source/Project/components/Project/CMakeFiles/ProjectMainController.dir/dataHandling/savingUnit/Trimmer.cpp.gcno: reached unexpected end of file
make[3]: *** [CMakeFiles/coverage] Error 255
make[2]: *** [CMakeFiles/coverage.dir/all] Error 2
make[1]: *** [CMakeFiles/coverage.dir/rule] Error 2

奇怪的是:我什至没有为Trimmer类编写任何测试,甚至没有TrimmerTest文件。你能帮助我吗?

最佳答案

通过完全删除构建文件夹的内容来解决此问题

关于c++ - C++ lcov到达文件意外结束,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/35965415/

10-10 01:00