问题描述
我可以通过lcov将.gcda文件和.gcno文件放在同一目录中,从而生成.info文件,但是如何在不同的位置使用.gcda文件和.gcno文件生成代码覆盖率?
I can generate .info files by lcov with .gcda files and .gcno files in the same directory, BUT how can I generate code coverage with .gcda files and .gcno files in defferent location?
例如
/Users/swd/Library/Developer/Xcode/DerivedData/test1aaeyiowcssrymfbwtudrqqakuvr/Build/Intermediates/test1.build/Cov/test1.build/Objects-normal/x86_64/AppDelegate.gcno
/Users/swd/Library/Developer/Xcode/DerivedData/test1aaeyiowcssrymfbwtudrqqakuvr/Build/Intermediates/test1.build/Cov/test1.build/Objects-normal/x86_64/AppDelegate.gcno
/Volumes/Data/test1/test1/AppDelegate.gcda
/Volumes/Data/test1/test1/AppDelegate.gcda
我尝试了--add-tracefile,但失败了,并输出'lcov:ERROR:在跟踪文件中找不到有效记录'
I tried --add-tracefile but failed, and output 'lcov: ERROR: no valid records found in trace file'
我的第二个问题是lcov是否具有一些将旧版本html与新版本html进行比较的命令,以便我可以找到差异.
My second question is whether lcov have some command to compare my old version coverage html to my new one, so that I can find the difference.
有什么想法吗?谢谢
推荐答案
如果设置了环境变量GCOV_PREFIX
,则可能会发生这种情况.请参见此处建议的解决方案是通过执行类似
This can happen if the environment variable GCOV_PREFIX
is set. See hereThe suggested solution is to release the .gcno
files to $GCOV_PREFIX
by doing something like
rsync -acv --filter='+ */' --filter='+ *.gcno' --filter='- *' <directory-containing-object-files> $GCOV_PREFIX
这篇关于lcov&如何处理不同目录中的.gcda和.gcno文件代码覆盖率比较的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!