2026-04-06 03:17:53 +08:00
|
|
|
#include "EditorValidationScenario.h"
|
|
|
|
|
|
|
|
|
|
#include <array>
|
|
|
|
|
|
|
|
|
|
#ifndef XCENGINE_EDITOR_UI_TESTS_REPO_ROOT
|
|
|
|
|
#define XCENGINE_EDITOR_UI_TESTS_REPO_ROOT "."
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
namespace XCEngine::Tests::EditorUI {
|
|
|
|
|
|
|
|
|
|
namespace {
|
|
|
|
|
|
|
|
|
|
namespace fs = std::filesystem;
|
|
|
|
|
|
|
|
|
|
fs::path RepoRootPath() {
|
|
|
|
|
std::string root = XCENGINE_EDITOR_UI_TESTS_REPO_ROOT;
|
|
|
|
|
if (root.size() >= 2u && root.front() == '"' && root.back() == '"') {
|
|
|
|
|
root = root.substr(1u, root.size() - 2u);
|
|
|
|
|
}
|
2026-04-06 16:20:46 +08:00
|
|
|
|
2026-04-06 03:17:53 +08:00
|
|
|
return fs::path(root).lexically_normal();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fs::path RepoRelative(const char* relativePath) {
|
|
|
|
|
return (RepoRootPath() / relativePath).lexically_normal();
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-06 16:20:46 +08:00
|
|
|
const std::array<EditorValidationScenario, 1>& GetEditorValidationScenarios() {
|
|
|
|
|
static const std::array<EditorValidationScenario, 1> scenarios = { {
|
2026-04-06 03:17:53 +08:00
|
|
|
{
|
2026-04-06 16:20:46 +08:00
|
|
|
"editor.shell.workspace_compose",
|
2026-04-06 03:17:53 +08:00
|
|
|
UIValidationDomain::Editor,
|
2026-04-06 16:20:46 +08:00
|
|
|
"shell",
|
|
|
|
|
"Editor 壳层 | 工作区组合",
|
|
|
|
|
RepoRelative("tests/UI/Editor/integration/workspace_shell_compose/View.xcui"),
|
2026-04-06 03:17:53 +08:00
|
|
|
RepoRelative("tests/UI/Editor/integration/shared/themes/editor_validation.xctheme"),
|
2026-04-06 16:20:46 +08:00
|
|
|
RepoRelative("tests/UI/Editor/integration/workspace_shell_compose/captures")
|
2026-04-06 03:17:53 +08:00
|
|
|
}
|
|
|
|
|
} };
|
2026-04-06 16:20:46 +08:00
|
|
|
|
2026-04-06 03:17:53 +08:00
|
|
|
return scenarios;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace
|
|
|
|
|
|
|
|
|
|
const EditorValidationScenario& GetDefaultEditorValidationScenario() {
|
|
|
|
|
return GetEditorValidationScenarios().front();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const EditorValidationScenario* FindEditorValidationScenario(std::string_view id) {
|
|
|
|
|
for (const EditorValidationScenario& scenario : GetEditorValidationScenarios()) {
|
|
|
|
|
if (scenario.id == id) {
|
|
|
|
|
return &scenario;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return nullptr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace XCEngine::Tests::EditorUI
|