使用gcov,是否可以合并为.gcda文件? [英] With gcov, is it possible to merge to .gcda files?

查看:1198
本文介绍了使用gcov,是否可以合并为.gcda文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将相同的源文件(C和Obj-C)编译为两个目标:单元测试可执行文件和实际产品(然后进行集成测试)。这两个目标构建到不同的地方,因此目标文件,.gcno和.gcda文件是分开的。并非所有的源文件都被编译到单元测试中,所以并不是所有的对象都会存在那里。所有源文件都被编译到产品版本中。

I have the same source files (C and Obj-C) being compiled into two targets: the unit test executable and the actual product (which then gets integration tested). The two targets build into different places, so the object files, .gcno and .gcda files are separate. Not all source files are compiled into the unit test, so not all objects will exist there. All source files are compiled into the product build.

有没有办法将两组.gcda文件合并为单元测试和集成测试的总覆盖率(因为它们在产品版本上运行)?

Is there a way to combine the two sets of .gcda files to get the total coverage for unit tests and integration tests (as they are run on the product build)?

我正在使用lcov。

Mac OS X 10.6 ,GCC 4.0

Mac OS X 10.6, GCC 4.0

谢谢!

Thanks!

推荐答案

lcov,你应该能够将gcov .gcda文件转换为lcov文件,并将它们与lcov --add-tracefile 合并。

Since you're using lcov, you should be able to convert the gcov .gcda files into lcov files and merge them with lcov --add-tracefile.


从手册页:添加tracefile的内容。
使用-a开关指定多个跟踪文件,通过为匹配的测试和文件名组合添加执行计数来合并这些文件中包含的覆盖率数据。

这篇关于使用gcov,是否可以合并为.gcda文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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