godot-gut-tests
БесплатноБез исполняемых скриптовНе проверенUse whenever GDScript code in a Godot project needs unit tests with GUT: install, tests extending GutTest, assertions including signals, lifecycle hooks…
от testland★ 18 звёзд на GitHubОб этом скилле
godot-gut-tests
Overview
This skill wraps GUT (Godot Unit Test) - the community-canonical GDScript test framework. Godot does not ship a first-party equivalent of Unity's Test Framework or Unreal's Automation System for GDScript user code.
Compatibility (per the GUT README):
| Engine | GUT version | Branch |
|---|---|---|
| Godot 4.6.x | 9.x | main |
| Godot 4.7.x | 9.x | godot_4_7 branch |
| Godot 3.4.x | 7.x (currently 7.4.3) | maintained |
Composes with:
platform-cert-overview-referencefor the canonical six test categories GUT tests map to, and for cert-gated requirements GUT tests should cover where the title ships to Xbox / PlayStation / Switch via Godot exports.gameplay-recording-replayfor replay-driven coverage authored on top of GUT.
When to use
- Unit under test is GDScript code in a Godot project (Godot 3.x or 4.x).
- You want a
before_each/after_each/ parameterised / mock test surface inside the editor with a CLI runner for CI. - You need JUnit XML export so a generic CI dashboard (GitHub Actions test reporter, Jenkins JUnit plugin, etc.) can surface failures.
For pure-C# tests inside Godot's C# scripting layer, use .NET-canonical test runners (xUnit, NUnit) rather than GUT - GUT is GDScript-first.
Authoring
Install
Two paths:
Asset Library (recommended for compatible engine versions):
- Inside the Godot editor → AssetLib tab.
- Search for "GUT" → install.
- Project → Project Settings → Plugins → enable GUT.
- Re-launch the editor.
Manual:
- Clone or download the GUT repo from github.com/bitwes/Gut.
- Copy the
addons/gut/directory into your project'saddons/directory. - Enable the plugin as above.
After enabling, a GUT panel appears in the bottom dock.
Project layout
Typical convention (the GUT runner defaults work with this):
my_godot_project/
addons/gut/ # the framework
src/
health.gd
enemy_ai.gd
test/
unit/
test_health.gd
test_enemy_ai.gd
integration/
test_save_load.gd
.gutconfig.json # optional config file
project.godot
Minimal test
Per gut.readthedocs.io, tests
"extend the GutTest class and use assertion methods like
assert_eq, assert_almost_eq, assert_true, and
assert_signal_emitted". Test methods are prefixed test_.
extends GutTest
func test_damage_deducts_correct_amount():
var health := preload("res://src/health.gd").new()
health.initialize(100)
health.apply_damage(35)
assert_eq(health.current, 65, "65 HP after 35 dmg from 100")
Lifecycle hooks
Lifecycle hooks:
| Hook | Scope |
|---|---|
before_all |
Once before every test in the script |
before_each |
Before each test_* method |
after_each |
After each test_* method |
after_all |
Once after every test in the script |
extends GutTest
var _player
func before_each():
_player = preload("res://src/player.gd").new()
func after_each():
_player.queue_free()
_player = null
func test_player_starts_with_full_health():
assert_eq(_player.health, _player.max_health)
Assertion family
Tests extend GutTest and call assertion methods; the most common are
assert_eq / assert_ne, assert_almost_eq (floats),
assert_true / assert_false, assert_null / assert_not_null,
assert_signal_emitted, and assert_called (spy). The full assertion table
is in references/assertions.md.
Inner classes (grouping)
Tests can be organised via inner classes:
extends GutTest
class TestAddItem:
extends GutTest
var _inv
func before_each():
_inv = preload("res://src/inventory.gd").new()
func test_increases_count_by_stack():
_inv.add_item("potion", 3)
assert_eq(_inv.count_of("potion"), 3)
func test_rejects_over_max_stack():
var ok = _inv.add_item("potion", 999)
assert_false(ok)
class TestRemoveItem:
extends GutTest
# …
Each inner class reports as its own grouping in the GUT panel.
Parameterised tests
GUT supports parameterized tests via params=[...]:
extends GutTest
var damage_cases = [
[100, 25, 75],
[100, 100, 0],
[50, 60, 0], # clamps to zero, not negative
[100, 0, 100],
]
func test_apply_damage_table(params=use_parameters(damage_cases)):
var health = preload("res://src/health.gd").new()
health.initialize(params[0])
health.apply_damage(params[1])
assert_eq(health.current, params[2])
Each row in damage_cases becomes its own test case in the
report.
Doubles, stubs, and spies
GUT provides doubling (full and partial), stubbing, and spies. Typical pattern:
extends GutTest
func test_save_calls_backend():
var backend_double = double("res://src/backend.g
Установить godot-gut-tests в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл godot-gut-tests?
Use whenever GDScript code in a Godot project needs unit tests with GUT: install, tests extending GutTest, assertions including signals, lifecycle hooks, parameterized tests, doubles, stubs and spies, async tests, the command-line runner with JUnit XML, and CI. GUT 9 for Godot 4, GUT 7 for Godot 3.
Как установить скилл godot-gut-tests?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл godot-gut-tests запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic