test(applets): add GTest unit tests for dde-apps classes (54 tests) - #1707
test(applets): add GTest unit tests for dde-apps classes (54 tests)#1707MyLeeJiEun wants to merge 1 commit into
Conversation
1. Add unit tests for CategoryUtils namespace functions 2. Add unit tests for ItemsPage pagination manager 3. Include 54 test cases covering all public API branches 4. Add CMake build integration with coverage support Influence: 1. Test category parsing with DDE and XDG format strings 2. Test page operations including insert, move, and remove 3. Verify edge cases like empty input and page overflow test: 添加 applets dde-apps 类的单元测试 1. 添加 CategoryUtils 命名空间函数的单元测试 2. 添加 ItemsPage 分页管理器的单元测试 3. 包含 54 个测试用例覆盖所有公共 API 分支 4. 添加 CMake 构建集成及覆盖率支持 Influence: 1. 测试 DDE 和 XDG 格式字符串的分类解析 2. 测试页面操作包括插入、移动和删除 3. 验证空输入和页面溢出等边界情况
|
[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. |
Reviewer's GuideAdds a new GTest-based unit test suite and coverage target for the pure-logic dde-apps applets classes (CategoryUtils and ItemsPage), wiring them into the existing tests build and ctest infrastructure without touching production src/ code. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Summary
Adds 54 GTest unit tests for the
applets/dde-appspure-logic classes of dde-shell, which previously had zero test coverage. This is the applets batch, separate from PR #1703 (frame batch) — no frame files are included here.Test scope (2 classes, 54 tests)
CategoryUtilsapplets/dde-apps/categoryutils.cppItemsPageapplets/dde-apps/itemspage.cppAll 54 tests pass (0 failed / 0 skipped / 0 crash). Sources under test are compiled into a single OBJECT library
applets_test_objects, linked into 2 test executables. No DConfig / DBus / Wayland runtime required — only pure-logic classes with no external singletons are included.Build
Coverage
Enable coverage through the build-system target:
cmake -B build -DBUILD_TESTING=ON -DAPPLETS_BUILD_COVERAGE=ON -DCMAKE_BUILD_TYPE=Debug cmake --build build --target applets_coverage # report: build/applets_coverage/html/index.htmllcov results (generated code excluded):
This PR does not modify
src/— tests only.Notes
tests/panels/dock/taskmanagerpattern (BUILD_TESTINGgate +gtest_discover_tests), registered with anapplets_ctest prefix soctest -R '^applets_'runs only this batch.applets/dde-appssources (appslaunchtimes, appsdockedhelper, appitem, appgroup, appgroupmanager, amappitemmodel, etc.) require DConfig / DBus mocks or Wayland runtime and are deferred.Tracking issue: DDE-107 补充 dde-shell 项目测试代码
Summary by Sourcery
Add unit-test coverage for the pure-logic dde-apps applet classes and integrate the tests into the project build.
Enhancements:
CategoryUtilsandItemsPageclasses inapplets/dde-apps.Build:
Tests: