Code coverage with GCOV can't produce .gcda file

主宰稳场 提交于 2019-12-22 18:45:31

问题


I want to get code coverage with GCOV, I set build setting by http://developer.apple.com/library/mac/#qa/qa2007/qa1514.html

  • add "-lgcov" to "Other Linker Flags"
  • check "Instrument Program Flow"
  • check "Generate Test Coverage Files"

but I can't produce the .gcda file, could anyone help?


回答1:


The simulator has to close before the gcda files get generated. So, when I run GHUnit I have to close this app first. There's also a setting in the plist to kill the app when it closes, rather than have it sit there ready to restart.




回答2:


I have posted the settings and configurations that worked for me at Code coverage not showing results using Xcode + gcov




回答3:


I had the same problem with Xcode 4.3.2. Setting "Generate Profiling Code" to YES caused that after testing gcda files are generated.



来源:https://stackoverflow.com/questions/4643158/code-coverage-with-gcov-cant-produce-gcda-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!