Repository navigation
refactor(test): move all sub-project tests to top-level test directory - #975
Merged
deepin-bot[bot] merged 1 commit intoNov 12, 2026
Conversation
|
Warning
详情 {
"export": {
"deepin-devicemanager-server/tests/run-ut.sh": {
"a": [
"export QT_QPA_PLATFORM=${QT_QPA_PLATFORM:-offscreen}",
"export ASAN_OPTIONS=${ASAN_OPTIONS:-detect_leaks=1}",
" export LSAN_OPTIONS=suppressions=\"$SCRIPT_DIR/lsan_suppressions.txt\"",
" export projectdir=\"$PROJECT_ROOT\"",
" export builddir=\"build-${TEST_DIR}\"",
" export reportdir=\"build-${TEST_DIR}\"",
" export GTEST_XML_DIR=\"$GTEST_XML_DIR\"",
" export COVERAGE_INFO=\"$BUILD_DIR/coverage.info\""
]
}
}
} |
Consolidate deepin-devicemanager/tests and deepin-devicemanager-server/ tests into a unified top-level test/ tree, wired from the root CMakeLists under the coverage guard. Hardcode test target names, fix escaping relative includes, and declare previously inherited include dirs in the client test build. Adapt test-prj-running.sh to build and run all four gtest binaries (client/server/control/customgpuinfo) and align lcov filters with the new test/ layout. Drop the stale server run-ut.sh runner. 将两个子项目的 tests/ 外移至顶层统一 test/ 目录,由根 CMakeLists 在 覆盖率开关下挂载;固定测试目标名,修复外移后的相对引用,并显式声明 原先继承的 include 路径;改造 test-prj-running.sh 统一运行全部 4 个 gtest 二进制,覆盖率过滤规则同步调整;删除已失效的 run-ut.sh。 Log: 子项目测试外移至顶层test目录并统一测试入口脚本 Influence: 单测代码位置与构建接线变化;test/test-prj-running.sh 成为 唯一测试入口,覆盖率统计不再包含测试源码本身(实测 3341 用例全通过, 行覆盖率 91.30%)。
add-uos
force-pushed
the
refactor-move-tests-to-top-level-test
branch
from
November 12, 2026 08:55
61e4481 to
509fba5
Compare
|
Warning
详情 {
"export": {
"deepin-devicemanager-server/tests/run-ut.sh": {
"a": [
"export QT_QPA_PLATFORM=${QT_QPA_PLATFORM:-offscreen}",
"export ASAN_OPTIONS=${ASAN_OPTIONS:-detect_leaks=1}",
" export LSAN_OPTIONS=suppressions=\"$SCRIPT_DIR/lsan_suppressions.txt\"",
" export projectdir=\"$PROJECT_ROOT\"",
" export builddir=\"build-${TEST_DIR}\"",
" export reportdir=\"build-${TEST_DIR}\"",
" export GTEST_XML_DIR=\"$GTEST_XML_DIR\"",
" export COVERAGE_INFO=\"$BUILD_DIR/coverage.info\""
]
}
}
} |
lzwind
approved these changes
Nov 12, 2026
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: add-uos, lzwind 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 |
Contributor
Author
|
/forcemerge |
Contributor
|
This pr force merged! (status: unstable) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
变更说明
将
deepin-devicemanager/tests与deepin-devicemanager-server/tests外移至仓库根目录统一test/树,由根 CMakeLists 在覆盖率开关(CMAKE_COVERAGE_ARG_ON)下挂载,非覆盖率构建不受影响。主要内容
test/{deepin-devicemanager,deepin-devicemanager-server}/,git 历史完整保留add_subdirectory(test/...);两个子项目 CMakeLists 移除原add_subdirectory(./tests)PROJECT_NAME作用域变化,测试目标名硬编码为deepin-devicemanager-test/deepin-devicemanager-server-test等 4 个,避免客户端/服务端目标名冲突../../../相对 includeDISABLE_DRIVER、QT_MESSAGELOGCONTEXT、QApt、DDLog)改为显式声明test/test-prj-running.sh改为从仓库根构建并运行全部 4 个 gtest 二进制(client/server/control/customgpuinfo,其中customgpuinfo-test此前从未被执行过),输出build-ut/(XML 报告 + lcov HTML +ut-summary.json)'*/tests/*'→'*/test/*',避免外移后的测试源码经'*/src/*'误入项目覆盖率统计run-ut.sh(其test_*二进制发现模式从未匹配到实际目标);gen-ut-summary.py去重为单份自测结果
Summary by Sourcery
Centralize sub-project unit tests under the top-level test tree and provide unified coverage-build execution and reporting.
Enhancements:
test/directory with explicit build dependencies and stable test target names.Build:
Tests:
Chores: