使用LLVM-COV使用Clang-CL编译器的代码覆盖范围,生成报告,其中丢失了测试文件覆盖范围

发布于 2025-01-20 11:25:21 字数 390 浏览 0 评论 0原文

我正在尝试在Visual Studio IDE中获得AC/C ++ LLVM-Clang项目的代码覆盖范围,该项目被编译为静态库,并且我使用GTEST编写了一个测试项目来测试包含不同源文件的静态库,我可以生成覆盖范围报告使用命令 llvm-cov.exe报告“ my-exe” -instr-profile =*。profdata ,但报告包含除我编写测试用例的文件外的所有文件。它只是忽略了覆盖范围中的这些文件。

我已经使用了标志-Frofile-instr-Generate,-fcoverage-映射和 - 覆盖过程中静态LIB代码期间的覆盖。它似乎也生成.gcno和.gcda文件。为什么忽略了书面案例的文件?

请注意,这些代码是在Visual Studio IDE中编译的。任何帮助都值得赞赏。

I am trying to get code coverage for a c/c++ llvm-clang project in visual studio IDE which is compiled as a static library and I have a test project written using Gtest to test the static library containing different source files, I can generate a coverage report using command llvm-cov.exe report "my-exe" -instr-profile=*.profdata but the report contains all the files except the files for which I have written the test cases. It simply ignores those files in the coverage.

I have used flags -fprofile-instr-generate, -fcoverage-mapping, and --coverage during the compilation of the static lib code. And it seems to generate .gcno and .gcda files as well. Why are the files for which the test cases written getting ignored?

Please note that the codes are compiled in Visual Studio IDE.Any help is appreciated.

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

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

发布评论

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