feat(xcui): advance core and editor validation flow

This commit is contained in:
2026-04-06 16:20:46 +08:00
parent 33bb84f650
commit 2d030a97da
128 changed files with 9961 additions and 773 deletions

View File

@@ -5,7 +5,6 @@
## 1. 目标
本规范只约束 XCUI 模块自身的测试体系,不负责复刻完整 editor 产品。
XCUI 测试体系固定为两条并行通道:
1. `unit`
@@ -14,7 +13,7 @@ XCUI 测试体系固定为两条并行通道:
两者必须同时存在,但职责严格分离:
- `unit` 负责规则、状态机、路由与回归稳定性,默认可自动执行。
- `integration` 负责生成可操作 exe让人直接检查交互、布局、焦点、shortcut、滚动与视觉状态。
- `integration` 负责生成可操作 exe让人直接检查交互、布局、焦点、 shortcut、滚动与视觉状态。
## 2. 顶层目录
@@ -38,15 +37,15 @@ tests/UI/
- `Core`
- 共享 UI 基础层测试。
- 例如 tree state、layout、focus、input router、shortcut、scroll、text controller。
- 例如 tree state、layout、focus、input router、shortcut、scroll、text controller、shared widget primitive
- `Runtime`
- 面向游戏运行时 UI 的测试。
- 例如 screen stack、layer blocking、runtime 输入路由、runtime-only widget。
- `Editor`
- 面向编辑器 UI 的测试。
- 例如 editor 输入宿主、editor shell 验证场景、editor-only widget。
- 例如 editor host、editor shell、editor-only widget、editor domain 集成
禁止把 `Runtime``Editor` 混在同一个测试目里。
禁止把 `Runtime``Editor` 混在同一个测试目里。
## 3. Unit 规范
@@ -71,21 +70,23 @@ tests/UI/
- 一个 exe 只验证一个聚焦场景。
- 每次只暴露当前批次需要检查的操作区域,不做大杂烩面板。
- 界面中的操作提示默认使用中文,必要时可混用 `hover``focus``active``capture` 等术语。
- 测哪一层,就把场景放到哪一层的 `integration/` 目录下。
`integration` 测试不负责:
- 模拟完整 editor 产品外壳。
- 把多个无关能力进同一个窗口。
- 把多个无关能力进同一个窗口。
- 代替底层 `unit` 回归。
## 5. Scenario 目录规范
### 5.1 Editor
### 5.1 Core
```text
tests/UI/Editor/integration/
tests/UI/Core/integration/
shared/
src/
themes/
<category>/
<scenario>/
CMakeLists.txt
@@ -96,8 +97,8 @@ tests/UI/Editor/integration/
约束:
- `shared/` 只放宿主、渲染、截图、scenario registry 等共用基础设施。
- `<category>` 表示能力类别,例如 `input`
- `shared/` 只放共享宿主、渲染、截图、scenario registry 等基础设施。
- `<category>` 表示共享能力类别,例如 `input``layout``style`
- `<scenario>` 是最小验证单元。
- 一个 `<scenario>` 对应一个 exe。
@@ -113,23 +114,49 @@ tests/UI/Runtime/integration/
captures/
```
Runtime 的集成测试结构与 Editor 保持同一规范,但宿主职责必须与 Editor 分离。
Runtime 的集成测试结构与 Core 保持同一规范,但宿主职责必须与 Core / Editor 分离。
## 6. 当前已有 Editor 场景
### 5.3 Editor
- `editor.input.keyboard_focus`
- `editor.input.pointer_states`
- `editor.input.scroll_view`
- `editor.input.shortcut_scope`
- `editor.layout.splitter_resize`
- `editor.layout.tab_strip_selection`
- `editor.layout.workspace_compose`
```text
tests/UI/Editor/integration/
<category>/
<scenario>/
CMakeLists.txt
main.cpp
[View.xcui]
captures/
```
这些场景只用于验证 XCUI 模块能力,不代表开始复刻完整 editor 面板
Editor 集成测试只承载 editor-only 场景,不再承载共享 Core primitive
补充规则:
- 当验证目标是 `editor-only` 状态机、workspace 装配或 panel 生命周期,而不是 XCUI markup 渲染本身时,允许使用 custom host 场景,不强制要求 `View.xcui`
- 即使使用 custom host也必须保持“一场景一个 exe、一个目录、一套独立 captures”。
## 6. 当前已有场景
### 6.1 Core
- `core.input.keyboard_focus`
- `core.input.pointer_states`
- `core.input.scroll_view`
- `core.input.shortcut_scope`
- `core.layout.splitter_resize`
- `core.layout.tab_strip_selection`
- `core.layout.workspace_compose`
这些场景只用于验证 XCUI 共享基础能力,不代表开始复刻完整 editor 面板。
### 6.2 Editor
- `editor.shell.workspace_compose`
- `editor.state.panel_session_flow`
## 7. 截图规范
Editor 集成宿主支持:
集成宿主支持:
- `F12` 手动截图。
- 截图只允许截当前 exe 自己的渲染结果。
@@ -164,5 +191,4 @@ XCUI 必须坚持自底向上的建设顺序:
## 9. 当前入口约定
当前 XCUI 的正式验证入口是 `tests/UI`
`new_editor` 不是后续 XCUI 测试体系的主入口,也不应继续承载新的测试场景扩展。