Why doesn't gcov report any lines being covered by my unit tests?

前端 未结 5 1615
暖寄归人
暖寄归人 2021-02-04 06:23

I am using Xcode 3.2 on 10.6, with the shipped version of gcov and default GCC compiler (both version 4.2.1). I have created a dependent Cocoa unit test bundle which is injected

5条回答
  •  囚心锁ツ
    2021-02-04 06:37

    In Xcode 4.6, coverage reports just seem to work. Turn on "Generate Test Coverage Files" and "Instrument Program Flow" for the app target, run the tests, then point the coverage tool at the output. That's in ~/Library/Developer/Xcode/Derived Data/-/Build/Intermediates/.build/Debug-iphonesimulator/.build; opening that folder in CoverStory shows me the results I expected.

    This GitHub repository contains scripts that can automatically discover the output and get lcov to visualise it; I'm happy with CoverStory for now.

提交回复
热议问题