【问题标题】:Branch Coverage is not showing in lcov Report for mock Functions模拟函数的 lcov 报告中未显示分支覆盖率
【发布时间】:2020-04-24 06:03:40
【问题描述】:

我正在尝试将 lcov 用于代码覆盖率指标,但分支覆盖率报告显示未涵盖模拟函数。

Attached image of report for reference purpose

【问题讨论】:

    标签: c++ unit-testing googletest


    【解决方案1】:

    通过在 CMake 中添加 -fno-exceptions 标志,我们解决了上述问题

    示例: 设置(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage -fno-exceptions -fno-inline")

    【讨论】:

      猜你喜欢
      • 2012-09-16
      • 2021-09-05
      • 2018-06-25
      • 2012-09-03
      • 1970-01-01
      • 2019-07-07
      • 2017-03-31
      • 2020-03-10
      • 1970-01-01
      相关资源
      最近更新 更多