如何找到所有C++的子集运行程序时实际使用的源/标头文件?

发布于 2025-02-01 02:42:48 字数 196 浏览 2 评论 0原文

我有一个大型项目,其中有1000次源文件,经常进行10秒的测试。因此,运行整个测试套件需要大量时间。当然,每个测试仅在代码覆盖范围内使用程序的某些部分。因此,当我更改一些源文件时,能够识别需要重新运行哪些测试将是很高兴的。

我认为我可以通过启用代码覆盖范围来编译程序,然后将结果求和到每个测试每次运行中的源/标头文件。该解决方案不必要地减慢了执行,有更好的方法吗?

I have a large project with 1000s of source files and 100s of tests often running for 10s of seconds. So running the whole test suite takes quite a bit of time. Of course each test only utilizes some part of the program in terms of code coverage. So when I change some source files it would be nice to be able to identify which tests need to be re-run.

I think I could do this with compiling the program with code coverage enabled, and then summing up the result to source/header files only per test run. This solution slows down the execution unnecessarily, is there a better way?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文