randallliuxin/godotmaker/gdunit-driver
Claude Code and agent skill by randallliuxin/godotmaker
- community
- ext:[{"type":"plugin","description":"Custom plugin integration"}]
Checking that the SKILL.md file is still in the repository.
Run gdUnit4 unit tests and parse results into structured output. Use this skill after writing or modifying code to verify correctness via unit tests, when diagnosing test failures, or when writing new test files. Triggers: "run tests", "test fails", "write a test", any gdUnit4/unit test mention. Supports both GDScript (.gd) and C# (.cs) test files.
Install
npx vskill@latest install randallliuxin/godotmaker/gdunit-driverSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as randallliuxin/godotmaker/gdunit-driver.
gdUnit4 Test Driver
$ARGUMENTS
1. Locate the Godot executable
Read the path from the project's config file. This avoids hardcoding paths that differ per machine.
2. Run tests
The CLI runner across all supported versions (v4.x, v5.x, v6.x) is addons/gdUnit4/bin/GdUnitCmdTool.gd. The path uses capital-U gdUnit4/ to match the upstream repo layout — Windows is case-insensitive but Godot's global script registry de-duplicates by exact path string, so a casing mismatch between the runner invocation and the on-disk directory triggers Class "..." hides a global script class parse errors and a non-zero exit.
Notes:
- Include
--ignoreHeadlessModefor headless runs. - Use
--addto enqueue test files or directories (repeat the flag for multiples). - Runner path needs the
res://prefix and the capital-Uaddons/gdUnit4/casing. - No
::methodsyntax for single test methods — run the whole file instead.
C# tests
GdUnitCmdTool.gd supports C# test files too, but ensure dotnet build passes first — gdUnit4 runs compiled assemblies, not source files.
Useful flags
| Flag | Purpose | |
|---|---|---|
--add <path> | Add test path to execution (file or directory; repeat to enqueue multiple) | |
--ignoreHeadlessMode | Allow headless execution | |
--report-directory <path> | Override report output directory |
Timeout
gdUnit4 has a default test timeout (configurable in GdUnitSettings). If tests hang:
- Check for infinite loops or unresolved
awaitcalls - Tests involving scene tree operations need explicit timeouts on await calls
- Kill the process after 120 seconds if no output appears
3. Parse results
Stdout parsing
GdUnitCmdTool.gd output contains ANSI color codes — strip them before parsing. Format:
Notes:
- Per-test lines start with
Run Test:; suite lines withRun Test Suite. - Duration is reported in milliseconds (
38ms). - Failure line numbers may show
line <n/a>instead of exact lines. - Summary uses
Statistics:with pipe-delimited counts. - Exit code 100 = test failures (not 1).
Extract from each test line:
- Name: the
test_*function name (after>). - Status:
PASSED,FAILED,SKIPPED,ERROR. - Duration:
Nmsafter the status. - Failure message: indented
Report:lines following a FAILED test (assertion details + source location if available).
JUnit XML report
Use --report-directory <path> for JUnit XML reports. The default report directory is res://reports/, which maps to project-root reports/.
Structured output format
Report results in this format:
Always include the file:line for failures — the agent (or user) needs this to navigate to the problem.
4. Writing tests
When the agent needs to write a new test file, follow these patterns.
GDScript test structure
Key assertion API
Scene fixtures
When testing code that needs nodes or scene tree:
auto_free() is critical — without it, test failures leak nodes and eventually crash the runner.
Stub design
A stub class must expose every property and method the system-under-test reads or calls on it.
Grep the system code for every property and method it touches on the stubbed argument; each one must exist on the stub class.
Async tests
For code involving signals, timers, or physics frames:
Always pass a timeout to wait_until() — unbounded waits hang the test runner.
SceneRunner (frame and input simulation)
When tests need _process / _physics_process to actually execute, or need to simulate player input, use gdUnit4's SceneRunner. Without it, adding a node to the tree does NOT advance frames — process callbacks never fire.
GDScript:
C#:
Key SceneRunner methods:
| GDScript | C# | Purpose | |
|---|---|---|---|
scene_runner(path) | ISceneRunner.Load(path) | Load scene for testing | |
runner.scene() | runner.Scene() | Get the root node | |
await runner.simulate_frames(n) | await runner.SimulateFrames(n) | Advance N frames | |
runner.set_property(name, val) | runner.SetProperty(name, val) | Set node property | |
runner.simulate_key_press(key) | runner.SimulateKeyPress(key) | Simulate key press | |
runner.simulate_action_pressed(action) | runner.SimulateActionPressed(action) | Simulate Input Map action | |
runner.simulate_mouse_move_absolute(pos) | runner.SimulateMouseMoveAbsolute(pos) | Move mouse to position | |
await runner.await_input_processed() | await runner.AwaitInputProcessed() | Wait for input processing |
When to use SceneRunner vs plain auto_free:
- Pure logic (math, data transforms): plain
auto_free(Node.new())+ direct calls — faster, simpler - Needs process callbacks: SceneRunner — process/physics actually run
- Needs input simulation: SceneRunner — only way to simulate keys/mouse/actions in tests
C# test structure
5. Common issues
"No tests found"
- Test file must
extends GdUnitTestSuite - Test methods must start with
test_(GDScript) or have[TestCase]attribute (C#) - File path must be correct — use
res://paths, not absolute OS paths
Test hangs indefinitely
- Missing timeout on
awaitcalls — always usewait_until(seconds)/WaitUntil(ms) - Process callbacks never fire — use SceneRunner with
simulate_frames()instead of rawadd_child() - Infinite loop in the code under test
- Scene tree waiting for a signal that never fires
- Kill the process and check which test was last reported
Scene leaks / orphan nodes
- Always wrap instantiated nodes with
auto_free() - If
before_test()creates nodes,after_test()should clean them up - gdUnit4 reports orphan nodes at the end — treat these as test failures
"Cannot load script" errors
- Check
class_nameconflicts between test and production code - Ensure the test file has valid syntax (run headless-build first)
- For C#: run
dotnet buildbefore running tests
"Headless mode is not supported" (exit 103)
GdUnitCmdToolrefuses headless by default- Add
--ignoreHeadlessModeto the command line — this is safe for non-UI tests - Input simulation tests won't work in headless (InputEvents are not transported)
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/core/gdunit-driver/SKILL.md
Popularity
- Repository stars
- 547
- Repository forks
- 48
- 7-day trend score
- 32
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Extension points
pluginCustom plugin integration
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/randallliuxin/godotmaker/gdunit-driver)