为Mac App获得0 gcov覆盖率 [英] Getting 0 gcov coverage for a mac app

查看:152
本文介绍了为Mac App获得0 gcov覆盖率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已完成以下操作,但我的.app仍获得0%的gcov覆盖率.这是我在做什么:

I have done the following but I am still getting 0% gcov coverage for my .app. Here is what I am doing:

  1. 我正在使用Xcode 3.2.6,GCC 4.2,并且在Mac OSX 10.6上运行.
  2. 我复制了Debug配置并将其命名为Gcov.在Gcov配置和应用程序目标中,我设置了以下构建配置:
    • 选中生成测试覆盖率文件"
    • 检查仪器程序流程"
    • 在其他链接器标志"中添加"-lgcov"
  1. I am using Xcode 3.2.6, GCC 4.2 and am on Mac OSX 10.6.
  2. I duplicated the Debug config and call it Gcov. In the Gcov config and the app target I set the following build configuration:
    • Check "Generate Test Coverage Files"
    • Check "Instrument Program Flow"
    • Add "-lgcov" to "Other Linker Flags"

关于我在做什么错的任何想法吗?谢谢你的帮助.

Any ideas as to what I am doing wrong? Thanks for any help.

推荐答案

检查您的gcc是否真的是 gccgcc --version.在较新的Mac上,gcc现在已链接到llvm-gcc,显然不支持gcov.如果发现是这种情况,请使用clang/clang++代替gcc/g++.

Check to see if your gcc is really gcc with gcc --version. On newer Macs, gcc is now linked to llvm-gcc, which evidently doesn't support gcov. If you find that this is the case, use clang/clang++ in lieu of gcc/g++.

这篇关于为Mac App获得0 gcov覆盖率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆