test: add comprehensive unit tests for dtkcore - #585
MyLeeJiEun wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Sorry @MyLeeJiEun, your pull request is larger than the review limit of 150,000 diff characters
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: MyLeeJiEun 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 |
|
Hi @MyLeeJiEun. Thanks for your PR. I'm waiting for a linuxdeepin member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
432f0e0 to
874f7bd
Compare
c5184be to
c0b208a
Compare
|
TAG Bot New tag: 6.7.50 |
1. Add 14 new test files covering DSysInfo, DConfig, DDBus, DCI, DFileSystemWatcher, DFileWatcher, DSettings, DTrash and more 2. Update 25 existing test files with improved coverage and fixes 3. Add dsysinfo_stub.cpp for LD_PRELOAD-based DSysInfo mocking 4. Update CMakeLists.txt with OBJECT library and stub integration 5. Tests validated: 808 passed / 0 failed across 15 execution rounds 6. Fix: update SPDX copyright header year to 2026 for 12 new test files (remove year ranges to pass CI SPDX validation) Influence: 1. Build with BUIILD_TESTING=ON and run ctest to verify all tests pass 2. Verify coverage metrics: line 85%, function 92.5%, branch 45.9% 3. Test DSysInfo mock with LD_PRELOAD stub in isolated environment test: 补充 dtkcore 单元测试代码 1. 新增 14 个测试文件,覆盖 DSysInfo、DConfig、DDBus、DCI、 DFileSystemWatcher、DFileWatcher、DSettings、DTrash 等模块 2. 更新 25 个已有测试文件,提升覆盖率并修复失败用例 3. 新增 dsysinfo_stub.cpp 实现 LD_PRELOAD 方式的 DSysInfo mock 4. 更新 CMakeLists.txt 集成 OBJECT 库与 stub 机制 5. 测试验证:15 轮执行 808 passed / 0 failed 6. fix: 更新新增测试文件 SPDX 版权头年份为 2026(去除年份范围) Influence: 1. 使用 BUIILD_TESTING=ON 编译并运行 ctest 验证全部测试通过 2. 验证覆盖率指标:行 85%、函数 92.5%、分支 45.9% 3. 在隔离环境中测试 DSysInfo mock 的 LD_PRELOAD stub 机制 PMS: TASK-DDE-209
c0b208a to
8c831bc
Compare
Summary
Add comprehensive unit test suite for dtkcore, with the full Debug + Asan run green.
Test Results
Changes
ut_*.cpp) covering DSysInfo, DConfig, DDBus, DCI, DFileSystemWatcher, DFileWatcher, DSettings, DTrash, and moredsysinfo_stub.cppfor LD_PRELOAD-based DSysInfo mockingCMakeLists.txtwith OBJECT library and stub integrationDSettingsGroup/DSettingsOptionresults fromfromJson()are non-owningQPointers and are now released by the fixtures, and DConfig's queueddeleteLater()work is drained before the exit-time leak checkSkipped tests
ut_DLicenseInfo.loadContentMissingFieldsandloadContentNonStringFieldsare skipped: they exerciseDLicenseInfoPrivate::loadContent()'s field-validation failure path, which builds aDComponentInfoand then returns without releasing it (it is not in
componentInfosyet), so ASan reports a leak atprocess exit. That is a library-side defect, not a test-side one, so it is left for a separate fix.
Related Issue
MUL-DDE-209
How to Build & Test
cmake -B build -DBUILD_TESTING=ON cmake --build build --target test cmake --build build --target coverage