Closed
[Bug-Report|缺陷反馈]: lcov>=2.0 严格校验导致 UT 覆盖率生成失败 #238
songkai111Add on  Jun 29Closed at  Jun 29
songkai111
songkai111Collaborators
Jun 29 Create

Describe the current behavior / 问题描述

scripts/util/generate_cpp_cov.sh 在 lcov >= 2.0 环境下执行 UT 覆盖率生成时,因新版 lcov 对若干条件(mismatch、empty、negative 等)进行严格校验,而脚本仅对部分命令传入了 --ignore-errors inconsistent,导致覆盖率采集(lcov -c)、过滤(lcov -r / lcov --remove)及 HTML 报告生成(genhtml)环节报错中断,无法生成覆盖率报告。

Environment / 环境信息

  • 软件环境:lcov >= 2.0
  • 受影响脚本:scripts/util/generate_cpp_cov.sh
  • 依赖环境变量:ASCEND_HOME_PATH / ASCEND_PARENT_PATH

Steps to reproduce the issue / 重现步骤

  1. 在已安装 lcov >= 2.0 的环境中运行 UT 并触发覆盖率生成脚本:
    bash scripts/util/generate_cpp_cov.sh <source_dir> <coverage_file> <out_path>
    
  2. 脚本执行到 lcov -c(采集)、lcov -r / lcov --remove(过滤)、genhtml(生成报告)时,因严格校验报错退出。

Describe the expected behavior / 预期结果

在 lcov >= 2.0 及更早版本环境下,覆盖率生成脚本均能稳定执行,正确生成 .info 覆盖率文件及 HTML 报告,不因版本差异而中断。

lcov >= 2.0 在 mismatch / empty / negative 等条件上执行严格校验,旧版仅忽略 inconsistent,故覆盖率生成流程中断。

Special notes for this issue / 备注

关联 PR:https://gitcode.com/cann/opbase/pull/574

likedislike
songkai111songkai111Collaborators
Jun 29 Added label: bug-report
songkai111
songkai111Collaborators
Jun 29 Comments:

/assign @songkai111

likedislike
CANN-robotCANN-robotCollaborators
Jun 29 Assign songkai111 as responsible person
CANN-robotCANN-robotCollaborators
Jun 29 Close issue
CANN-robotCANN-robotCollaborators
Jun 29 Added label: resolved