一键导入
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.
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 reachable scene/component state, scene/prefab/menu automation, and PlayMode checks
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 |
| toolName | 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. 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 running tests, run uloop compile first if you created, deleted, renamed, moved, or edited C# files, test files, .asmdef/.asmref, or package manifests since the last successful compile. This refreshes the AssetDatabase and surfaces compile errors before test execution.
Before executing tests, uloop run-tests saves unsaved loaded Scene changes and unsaved current Prefab Stage changes by default. If saving fails, it returns Success: false, keeps TestCount at 0, lists the unsaved items in Message, and does not start the Unity Test Runner.
NoTestsFound means zero tests matched — not a test failure. Check NoTestsFoundExplanation and Message for asmdef hints.
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) |
--fail-on-unsaved-changes | flag | - | Fail before test execution if unsaved editor changes remain instead of auto-saving them |
| 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
# Fail instead of auto-saving when editor changes are unsaved
uloop run-tests --fail-on-unsaved-changes
# 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 passedStatus (string): Machine-readable execution status such as Passed, Failed, NoTestsFound, or ExecutionFailedHasFailures (boolean): Whether any discovered test failedMessage (string): Summary messageNoTestsFound (boolean): Whether Unity Test Runner discovered zero matching testsNoTestsFoundExplanation (string): Agent-facing explanation when NoTestsFound is true; empty otherwiseCompletedAt (string): ISO timestamp when the run finishedTestCount (number): Total tests executedPassedCount (number): Passed testsFailedCount (number): Failed testsSkippedCount (number): Skipped testsXmlPath (string): Path to NUnit XML result file. Empty string when no XML was saved (typically on Success: true); 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>