gpt4 book ai didi

c++ - gcov 的排除标记

转载 作者:搜寻专家 更新时间:2023-10-31 01:41:58 26 4
gpt4 key购买 nike

我正在使用 gcov 测量我的 C++ 代码中的覆盖率。我希望能够标记某些源代码行,以便在使用 gcovr 时将它们排除在覆盖率报告之外。我知道它们存在,因为我曾经偶然发现过它们,但现在我找不到看到它们的地方了。

我没有使用 lcov 来报告覆盖率,因此对此类标记的引用对我没有好处。

谁能指出我正确的位置?

最佳答案

我终于明白了。 lcov 排除标记对 gcovr 有效。

The following markers are recognized by geninfo:

  • LCOV_EXCL_LINE
    • Lines containing this marker will be excluded.
  • LCOV_EXCL_START
    • Marks the beginning of an excluded section. The current line is part of this section.
  • LCOV_EXCL_STOP
    • Marks the end of an excluded section. The current line not part of this section.

您也可以用 'GCOV''GCOVR' 替换上面的 'LCOV'。它们都有效。

关于c++ - gcov 的排除标记,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27623733/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com