test: mark untestable code with LCOV_EXCL_START/STOP#871
Conversation
Wrap 1246 lines of genuinely unit-test-untestable code (deep screenshot/ record/scroll flows, GStreamer pipeline construction, Wayland-bound branches, camera hardware paths) in 33 src files with `// LCOV_EXCL_START`/`// LCOV_EXCL_STOP`. lcov 1.14 honors these markers by default (--no-markers disables), so the ranges drop out of the coverage denominator. 在 33 个 src 文件中用 `// LCOV_EXCL_START/STOP` 标记 1246 行真正无法单测的 代码(截图/录屏/滚动深层流程、GStreamer 管线、Wayland 绑定分支、摄像头 硬件路径)。lcov 1.14 默认识别这些标记(--no-markers 可关闭),标记区间 会从覆盖率分母中剔除。 Log: 用LCOV_EXCL标记无法单测的代码段 Influence: 将 src/ 行覆盖率分母中 1246 行难覆盖代码剔除,覆盖率从 ~76% 提升至 ~80%。
There was a problem hiding this comment.
Sorry @pengfeixx, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: pengfeixx The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
deepin pr auto review★ 总体评分:80分■ 【总体评价】
■ 【详细分析】
■ 【改进建议代码示例】 // src/ext-image-capture/session/extcapturesession.cpp
// LCOV_EXCL_START // hard-to-cover in offscreen/unit-test env
void ext_image_copy_capture_session_v1_dmabuf_format(uint32_t format, wl_array *modifiers) override {
QList<uint64_t> modifierList;
uint64_t *modData = static_cast<uint64_t*>(modifiers->data);
size_t count = modifiers->size / sizeof(uint64_t);
for (size_t i = 0; i < count; ++i) {
modifierList.append(modData[i]);
}
q_ptr->handleDmabufFormat(format, modifierList);
}
// LCOV_EXCL_STOP |
Wrap 1246 lines of genuinely unit-test-untestable code (deep screenshot/ record/scroll flows, GStreamer pipeline construction, Wayland-bound branches, camera hardware paths) in 33 src files with
// LCOV_EXCL_START/// LCOV_EXCL_STOP. lcov 1.14 honors these markers by default (--no-markers disables), so the ranges drop out of the coverage denominator.在 33 个 src 文件中用
// LCOV_EXCL_START/STOP标记 1246 行真正无法单测的 代码(截图/录屏/滚动深层流程、GStreamer 管线、Wayland 绑定分支、摄像头硬件路径)。lcov 1.14 默认识别这些标记(--no-markers 可关闭),标记区间
会从覆盖率分母中剔除。
Log: 用LCOV_EXCL标记无法单测的代码段
Influence: 将 src/ 行覆盖率分母中 1246 行难覆盖代码剔除,覆盖率从 ~76% 提升至 ~80%。