test: add test build infra and daemon/start-manager tests - #560
Conversation
There was a problem hiding this comment.
Sorry @pengfeixx, your pull request is larger than the review limit of 150,000 diff characters
deepin pr auto review🤖 AI 代码审查报告📊 总体评价
🔍 详细分析1. 语法逻辑 ✅评价: 优秀 ✅ 通过 潜在问题:
建议: 建议对不确定存在的子目录使用 add_subdirectory_if_exists(UnitTestUtils.cmake 已提供该函数),或在 PR 中说明这些目录已存在于 master 分支 2. 代码质量 ✅评价: 良好 ✅ 通过 潜在问题:
建议: 1. ut_setcodec_compat.h 宏建议改为更安全的方式,如在宏名中添加前缀避免冲突,或使用内联函数替代 3. 代码性能 ✅评价: 优秀 ✅ 通过 潜在问题:
建议: 测试场景下 busy-wait 可接受,若需优化可考虑使用 QSignalSpy::wait 或 QTimer::singleShot 替代 4. 代码安全 🔒评价: 优秀 ✅ 通过
安全漏洞详情: 建议: 无安全风险,安全合规 💡 改进建议代码示例// ut_setcodec_compat.h 改进建议:使用更安全的宏名
#pragma once
#include <QStringConverter>
// 使用带前缀的宏名,避免与其他 setCodec 调用冲突
#define UT_SETCODEC_COMPAT(a) setEncoding(QStringConverter::Utf8)
// test-prj-running.sh 改进建议:加引号保护
# rm -rf "$builddir"
# rm -rf "$reportdir"本报告由 AI 代码审查工具自动生成 |
9fc3dd7 to
a5d8517
Compare
|
Warning
详情 {
"unset": {
"tests/startmanager/test_startmanager_drag.cpp": {
"b": [
" qunsetenv(\"XDG_CONFIG_HOME\");",
" qunsetenv(\"XDG_DATA_HOME\");"
]
}
},
"export": {
"tests/test-prj-running.sh": {
"b": [
"export QT_QPA_PLATFORM=offscreen"
]
}
}
} |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: lzwind, 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 |
Add unit test build infrastructure (UnitTestUtils.cmake, run scripts, BUILD_TESTS option, README) and GTest suites for daemon, dbus and start manager modules. 新增单元测试构建基础设施(UnitTestUtils.cmake、运行脚本、BUILD_TESTS 开关、README),以及 daemon、dbus、startmanager 模块的 GTest 单元测试。 Log: 新增测试构建基础设施及 daemon/startmanager 单元测试 Influence: 仅新增测试与构建脚本,不影响编辑器本体功能。
a5d8517 to
04c7aca
Compare
|
Warning
详情 {
"unset": {
"tests/startmanager/test_startmanager_drag.cpp": {
"b": [
" qunsetenv(\"XDG_CONFIG_HOME\");",
" qunsetenv(\"XDG_DATA_HOME\");"
]
}
},
"export": {
"tests/test-prj-running.sh": {
"b": [
"export QT_QPA_PLATFORM=offscreen"
]
}
}
} |
内容
新增单元测试构建基础设施(UnitTestUtils.cmake、BUILD_TESTS 构建开关、运行脚本、README),以及 daemon(含 dbus)、startmanager 模块的 GTest 单元测试,共 20 个文件。
说明