Skip to content

feat: add unit tests for core modules and protocol integration tests#1046

Draft
deepin-wm wants to merge 1 commit into
linuxdeepin:masterfrom
deepin-wm:feat/add-unit-tests
Draft

feat: add unit tests for core modules and protocol integration tests#1046
deepin-wm wants to merge 1 commit into
linuxdeepin:masterfrom
deepin-wm:feat/add-unit-tests

Conversation

@deepin-wm

Copy link
Copy Markdown
Contributor

Replaces closed PR #1040 with the complete unit test suite including CI fixes.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @deepin-wm, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@deepin-ci-robot

Copy link
Copy Markdown

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: deepin-wm

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@deepin-wm deepin-wm force-pushed the feat/add-unit-tests branch 3 times, most recently from 6a8dd7a to 74f4dcb Compare June 23, 2026 12:41
1. Add 6 core unit test directories covering gestures, togglable gestures, shortcut controller, wallpaper config, output config state, and protocol integration
2. Add 7 additional mock-based test directories covering backlight, lockscreen, greeter proxy, output scale, window config store, xresource, and xsettings
3. Fix testSwipeGesturePositionConstraints: maximumX expected value corrected to 99 (QRect::right() = x + width - 1)
4. Fix testDeactivateTriggeredExactHalfFactor: expected state changed to Active when factor == 0.5 (< 0.5 is false, goes to activate branch)
5. Fix test_protocol_integration TIMEOUT from 15s to 60s
6. Add TODO comments for modules requiring runtime dependencies
7. Make Output::constrainToValidArea and XResource::splitXResourceLine accessible for testing
8. Fix GestureRecognizer unregister/deleteLater double-free risk
9. Fix protocol integration test compilation (lambda captures, WServer::attach template usage)

Log: Added comprehensive unit tests for treeland core modules and protocol integration

Influence:
1. Run ctest to verify all unit tests pass
2. Verify test_protocol_integration runs within 60s timeout
3. Test gesture position constraints with QRect boundary values
4. Test togglable gesture state transitions at exact 0.5 factor

feat: 为核心模块添加单元测试及协议集成测试

1. 新增6个核心单元测试目录,覆盖手势、可切换手势、快捷键控制器、壁纸配置、输出配置状态和协议集成
2. 新增7个基于mock的测试目录,覆盖背光、锁屏、欢迎代理、输出缩放、窗口配置存储、X资源和X设置
3. 修复testSwipeGesturePositionConstraints:maximumX期望值修正为99(QRect::right() = x + width - 1)
4. 修复testDeactivateTriggeredExactHalfFactor:factor==0.5时期望状态改为Active(< 0.5为false,走activate分支)
5. 修复test_protocol_integration TIMEOUT从15s改为60s
6. 为需要运行时依赖的模块添加TODO注释
7. 使Output::constrainToValidArea和XResource::splitXResourceLine可测试
8. 修复GestureRecognizer unregister/deleteLater双重释放风险
9. 修复协议集成测试编译问题(lambda捕获,WServer::attach模板用法)

Log: 新增treeland核心模块和协议集成的综合单元测试

Influence:
1. 运行ctest验证所有单元测试通过
2. 验证test_protocol_integration在60s超时内运行
3. 测试QRect边界值的手势位置约束
4. 测试可切换手势在精确0.5因子时的状态转换

Fixes: linuxdeepin#1040
PMS: TASK-385999
@deepin-wm deepin-wm force-pushed the feat/add-unit-tests branch from 74f4dcb to 9630b44 Compare June 23, 2026 13:19
@deepin-bot

deepin-bot Bot commented Jun 26, 2026

Copy link
Copy Markdown

TAG Bot

New tag: 0.8.13
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #1063

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants