Gcovr生成0个文件的覆盖率数据 [英] Gcovr generates coverage data for 0 files
问题描述
我正在为iOS应用程序设置代码覆盖率.我正在使用XCode 5.0.2和gcovr 3.1来测试和执行iOS 7设备的代码覆盖率.最初,我在生成.gcda
文件时遇到问题,但我遵循了此博客并解决了该问题
I am setting up code coverage for an iOS application. I am using XCode 5.0.2 and gcovr 3.1 to test and perform code coverage for iOS 7 devices. I initially had issues with .gcda
file generation but I followed this blog and resolved the issue.
我仅对于调试模块将生成测试覆盖率文件"设置为是",将仪器程序流"设置为是".我还在其他C标志"中为调试模块设置了-fprofile-arcs -ftest-coverage
.当应用程序终止时,我已经在我的应用程序代码中添加了__gcov_flush()
.
I have set ‘Generate test coverage files’ to ‘Yes’, ‘Instrument Program flow’ to ‘Yes’ for the Debug module only. I have also set -fprofile-arcs -ftest-coverage
for Debug module in ‘Other C Flags’. I have added __gcov_flush()
in my app code when application terminates.
现在,生成的.gcda文件没有问题.
Now .gcda files are generating without issues.
然后将其复制到主目录中的工作区中.从工作区,我尝试为应用程序运行代码覆盖率.我从命令行执行gcovr
命令,为我拥有的252个gdca文件传递了–object-directory
和gcov
命令.最后,我得到以下输出:
I then copy that to my workspace in my Home directory. From the workspace, I try to run code coverage for the application. I execute the gcovr
command from the command line, passing –object-directory
and gcov
command runs for the 252 gdca files I have. In the end I get this output:
Gathered coverage data for 0 files
请帮助我解决问题.我已经花了很多时间浏览类似的问题,但是没有一个解决方案能解决这个问题.
Please help me in solving the issue. I have spent a lot of time browsing for similar issues but none of the solutions is working out.
推荐答案
我没有尝试将.gcda文件复制到其他地方,但是如果我cd到默认情况下生成gcda文件的目录,请使用没有参数,我得到有效的结果.也许这就是您需要做的?
I haven't tried copying the .gcda files elsewhere, but if I cd to the directory that the gcda files are generated in by default, then run gcovr with no arguments, I get valid results. Perhaps that's what you need to do?
这篇关于Gcovr生成0个文件的覆盖率数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!