一键导入
uloop-run-tests
Run Unity Test Runner and report detailed results. Use for EditMode/PlayMode tests, change verification, or failure diagnosis.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Run Unity Test Runner and report detailed results. Use for EditMode/PlayMode tests, change verification, or failure diagnosis.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Clear Unity Console entries. Use before compile, tests, or debugging when stale logs would hide the current result.
Compile the Unity project and report errors/warnings. Use after C# edits or when a full Domain Reload compile is needed.
Control Unity Editor Play Mode. Use to start, stop, or pause Play Mode for runtime behavior checks and frame inspection.
Execute C# with Unity APIs when existing uloop tools cannot inspect or edit enough. Use for scene, prefab, SerializedObject, AssetDatabase refresh/.meta generation, menu, or PlayMode automation.
Find or inspect Unity GameObjects, especially objects the user currently selected in the Hierarchy. Use for details, components, tags, layers, or name/path searches.
Bring the Unity Editor window to front. Use when Unity must be visible for visual checks or user-facing interaction.
| name | uloop-run-tests |
| description | Run Unity Test Runner and report detailed results. Use for EditMode/PlayMode tests, change verification, or failure diagnosis. |
Execute Unity Test Runner. This command requires the Unity Test Framework package (com.unity.test-framework). If that package is not installed, the command returns Success: false with an unsupported message and does not affect the other Unity CLI Loop tools.
When tests fail, NUnit XML results with error messages and stack traces are automatically saved. Read the XML file at XmlPath for detailed failure diagnosis.
Before executing tests, uloop run-tests checks for unsaved loaded Scene changes and unsaved current Prefab Stage changes. If any are found, it returns Success: false, keeps TestCount at 0, lists the unsaved items in Message, and does not start the Unity Test Runner. Save or discard those editor changes, then rerun the command. Use --save-before-run true only when the user explicitly asks to save editor changes before continuing.
uloop run-tests [options]
| Parameter | Type | Default | Description |
|---|---|---|---|
--test-mode | string | EditMode | Test mode: EditMode, PlayMode |
--filter-type | string | all | Filter type: all, exact, regex, assembly |
--filter-value | string | - | Filter value (test name, pattern, or assembly) |
--save-before-run | boolean | false | Save unsaved loaded Scene changes and current Prefab Stage changes before running tests |
| Option | Description |
|---|---|
--project-path <path> | Optional. Use only when the target Unity project is not the current directory. |
# Run all EditMode tests
uloop run-tests
# Run PlayMode tests
uloop run-tests --test-mode PlayMode
# Save explicitly approved editor changes before running tests
uloop run-tests --save-before-run true
# Run specific test
uloop run-tests --filter-type exact --filter-value "MyTest.TestMethod"
# Run tests matching pattern
uloop run-tests --filter-type regex --filter-value ".*Integration.*"
Returns JSON with:
Success (boolean): Whether all tests passedMessage (string): Summary messageCompletedAt (string): ISO timestamp when the run finishedTestCount (number): Total tests executedPassedCount (number): Passed testsFailedCount (number): Failed testsSkippedCount (number): Skipped testsXmlPath (string | null): Path to NUnit XML result file. null when no XML was saved; populated only when tests failed and the XML file exists on disk.When tests fail, NUnit XML results are automatically saved to {project_root}/.uloop/outputs/TestResults/<timestamp>.xml. The XML contains per-test-case results including:
<message> (assertion error) and <stack-trace>