开发者

Does LLVM have test coverage support in Xcode 4?

开发者 https://www.devze.com 2023-03-21 09:49 出处:网络
Does clang/llvm have support to produce test coverage files a开发者_开发问答s was the case with GCC which produced .gcov files. if yes how? I hear that XCode is still under NDA, but I can talk about L

Does clang/llvm have support to produce test coverage files a开发者_开发问答s was the case with GCC which produced .gcov files. if yes how?


I hear that XCode is still under NDA, but I can talk about LLVM and Clang. LLVM now knows how to emit .gcno files when compiling, and .gcda files when your program is run (linked against libprofile_rt). Inside LLVM, this uses the data from debug info to associate the code with the file and line number information.

To use it, you'll need LLVM and Clang from SVN HEAD. That clang should support the same flags that gcc does for building with coverage; --coverage will do, or you can use -ftest-coverge and -fprofile-arcs individually. For linking, GCC supported -lgcov which is wrong for clang+llvm and should be replaced with --coverage, as the LLVM version of the library is named profile_rt, not libgcov.

0

精彩评论

暂无评论...
验证码 换一张
取 消