ut: 覆盖率缺口补全单元测试(批次1) - #729
Conversation
补全以下类此前函数覆盖率为 0 或存在缺口的 getter/纯逻辑方法用例: - EDIDParser: hexToBin(十六进制转二进制,含合法输入与边界) - DriverInfo(MacroDefinition.h): backupFileName/modelName/driverName/vendorName 四个 getter - CommonTools: 构造函数与静态 feedback() - PageInfo: packageHasInstalled(dpkg -s 包查询) - Device* 系列 vendor() 等 getter:DeviceAudio/DeviceBluetooth/DeviceCdrom/ DeviceComputer/DeviceGpu/DeviceImage/DeviceInput/DeviceMemory/DeviceMonitor/ DeviceOtherPCI/DeviceOthers/DevicePower/DevicePrint - DeviceBios: tomlname - DevicePrint: makeAndeModel - DeviceNetwork: vendor/isWireless/hwAddress/canDisable - DeviceStorage: getManfName/getOemName 所有新增用例均接入既有 tests/src 目录(CMake 递归 glob 自动收录), 仅新增独立测试文件,不修改已有测试与源码。 批次统计: - 新增测试文件:5 - 新增用例:37(全部通过,0 失败 0 跳过) - 整体用例数:1137,通过 1131,失败 6 (6 项失败为既有用例,均与键盘/hwinfo/hciconfig 硬件相关,非本批次引入) - 函数覆盖率:87.3%(1324/1517) → 89.2%(1354/1517),+30 函数 - 本批次使 8 个文件达到 100% 函数覆盖: EDIDParser.cpp / commontools.cpp / PageInfo.cpp / MacroDefinition.h / DeviceBios.cpp / DeviceNetwork.cpp / DevicePrint.cpp / DeviceStorage.cpp 基线 commit: - baseline_commit: 89825dc - baseline_title: fix(gpu): fix GPU VRAM size parsing failure on multi-line gpu-info - baseline_date: 2026-08-06
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: add-uos 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 |
Reviewer's GuideAdds a first batch of standalone GoogleTest unit tests to close function coverage gaps in deepin-devicemanager, targeting EDIDParser::hexToBin, DriverInfo inline getters, CommonTools construction and feedback(), PageInfo::packageHasInstalled, and several Device* getter methods including DeviceNetwork and DeviceStorage logic, without modifying any production or existing test code. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
TAG Bot New tag: 6.0.70 |
概述
deepin-devicemanager 单元测试补全 —— 批次1(覆盖率缺口补全)。
本 PR 仅新增独立测试文件,不修改已有测试与源码;新增文件接入既有
deepin-devicemanager/tests/src/目录,由 CMake 递归 glob 自动收录,无需改动共享 CMakeLists。本批次覆盖的类与方法
hexToBinbackupFileName/modelName/driverName/vendorNamefeedback()packageHasInstalledvendor()tomlnamemakeAndeModelvendor/isWireless/hwAddress/canDisablegetManfName/getOemName新增文件
tests/src/GenerateDevice/ut_edidparser_hextobin.cpptests/src/ut_driverinfo_getters.cpptests/src/Tool/ut_commontools_feedback.cpptests/src/Page/ut_pageinfo_packagehasinstalled.cpptests/src/DeviceManager/ut_device_getters_covgap.cpp验证
CMAKE_COVERAGE_ARG=ON,关闭 ASan),客户端测试目标编译链接通过。QT_QPA_PLATFORM=offscreen,整体 1137 用例,通过 1131,失败 6。src/,排除 tests/3rdparty):87.3%(1324/1517) → 89.2%(1354/1517),+30 函数。基线
89825dcd后续
本批次为多批次覆盖率补全的第一批。剩余约 163 个未覆盖函数(多为硬件相关 getter、虚析构、GUI 事件槽、lambdas 等)将按类/模块在后续批次与 PR 中继续补全。CI 运行中,详见检查状态。
Summary by Sourcery
Add a first batch of unit tests to close coverage gaps in deepin-devicemanager without modifying production code.
New Features:
Tests: