/godot-dev:godot-testingfrom godot-dev
Runs Godot GDScript unit tests headless with no add-on required. Provides a runner, assertions, per-test error catching, CI exit codes, and supports GUT/gdUnit4 as alternatives.
Ships in godot-dev. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
A SceneTree script can load test files, call their test_ methods and exit non-zero on a
failure; nothing has to be installed.
| The situation | Read |
|---|---|
| "Add tests", "test this rule", a first test in a project | Start below, then templates/test_route_math.gd |
| How tests are found and called; the checker; async tests; what PASS, FAIL and ERROR mean | reference/runner.md |
| A test run in CI; an exit code you need to branch on; class_name not found in tests | reference/runner.md → "In CI", and scripts/run_tests.py |
A test that hangs; assert() that freezes a script | reference/runner.md → "Two ways a test can hang" |
| GUT or gdUnit4: what they add, using one safely | reference/addons.md |
| Whether the whole change works (import, load, scenes) | godot-verify |
| A moment of the game played through input, a timeline | godot-play-harness |
| Typed GDScript, warnings raised to errors, signals and await | godot-gdscript |
resources/run_tests.gd and resources/test_case.gd into res://tests/.templates/test_route_math.gd there and point its preload at the script under test
(templates/route_math.gd is the example it tests).GODOT_BIN=/path/to/Godot python3 scripts/run_tests.py path/to/project
run tests: exit 1, 0.1s
FAIL res://tests/test_bag.gd::test_bag_capacity: FAIL deliberately wrong: got 4, want 5
run_tests: FAIL 1 problem; 4 passed, 1 failed, 0 errors; 5 tests in 2 files
| Exit | Verdict | When |
|---|---|---|
| 0 | PASS | TESTS_DONE says every test passed, at least one ran, and no marker appeared outside a test |
| 2 | FAIL | a failed check, an error inside a test, a test file that does not load, zero tests, or an error outside any test (an autoload at startup, a node leaked at exit) |
| 3 | UNVERIFIED | a timeout (the hung test is named), no TESTS_DONE line, counts that disagree, no binary |
| 1 | refused / usage | no project.godot, no runner at --runner, a bad flag |
| Flag | Effect |
|---|---|
--godot PATH | the binary; default $GODOT_BIN; never guessed |
--runner res://... | where run_tests.gd sits (default res://tests/run_tests.gd) |
--dir res://... | the folder searched for test_*.gd (default res://tests) |
--match TEXT | only tests whose path::name contains it |
--frames N | each test's frame budget for awaiting (default 600) |
--import auto|always|never | --import first; auto when a class_name needs the class cache |
--timeout S / --backstop N | wall clock per run (300) / --quit-after (100000) |
--fixed-fps N | one physics tick per frame, no real-time wait (default 60; 0 real time) |
--allow-warnings | warnings outside tests become NOTE lines |
The runner also runs by itself, with no Python: -s res://tests/run_tests.gd -- res://tests,
then require the TESTS_DONE line (reference/runner.md).
extends RefCounted
const RouteMath = preload("route_math.gd")
func test_eta_divides_distance_by_speed(t: RefCounted) -> void:
t.check_eq(RouteMath.eta_seconds(100.0, 4.0), 25.0, "100 m at 4 m/s")
func test_zero_speed_never_arrives(t: RefCounted) -> void:
t.check(is_inf(RouteMath.eta_seconds(10.0, 0.0)), "zero speed gives INF")
Each test_ method gets t, the checker: check, check_eq, check_near, fail, and for
tests that need the tree, await t.frames(n), t.add(node) (freed after the test) and t.tree.
Checks record and return, so a test lists every broken expectation. A runtime error, a failed
assert() or a push_error() inside a test makes that test an ERROR, and the run goes on.
RefCounted script with static functions, or a Resource, tested directly.
This is where unit tests pay; a rule that only exists inside a node's _process is a rule
that cannot be tested. Move it out.t.add and await t.frames: a node enters the tree, a signal
fires. Keep it small.godot-play-harness. Whether every script and scene loads: godot-verify.quit(1) is only reached if the runner gets that far. Require TESTS_DONE.--match that matches nothing runs no
test and would otherwise look green.quit() leaves the tree running (godot-verify →
reference/timeouts.md).class_name. Without the class cache the test file does not
load, which reads as a broken test rather than a missing step.t.add. A leaked node prints a warning at exit,
and the run fails on it.test_zero_speed_never_arrives), so a FAIL line reads as the
broken rule.| Not here | Go to |
|---|---|
| The verdict on a whole change: import, load, scenes | godot-verify |
| Journeys, situations, input from a script, timelines | godot-play-harness |
| GDScript itself: typing, warnings, signals, await | godot-gdscript |
| Flags and running Godot from a terminal | godot-cli |
reference/addons.md (opens in a new tab)reference/runner.md (opens in a new tab)resources/run_tests.gd (opens in a new tab)resources/test_case.gd (opens in a new tab)scripts/run_tests.py (opens in a new tab)templates/route_math.gd (opens in a new tab)templates/test_route_math.gd (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
28 skills in this plugin
/godot-2d-controllerMove a 2D character in Godot: CharacterBody2D jump, coyote time, jump buffer, slopes, one-way and moving platforms, top-down movement./godot-2d-renderingGodot 2D look: draw order, z_index and y-sort, CanvasLayer, 2D lights and shadows, canvas shaders, Parallax2D, pixel-perfect scaling./godot-2d-rigA layered 2D character into Godot: rig2d.json to Skeleton2D, Bone2D and weighted Polygon2D parts, cut-out animation, 2D IK.npx claudepluginhub tipoli5890/game-studio --plugin godot-dev