chore(client): add gdUnit4 test framework addon

Vendor gdUnit4 for Godot 4 client testing (D-030).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-11 16:52:00 +01:00
co-authored by Claude Opus 4.6
parent 3a2fe4bd71
commit 61e0762a84
979 changed files with 55221 additions and 0 deletions
@@ -0,0 +1,45 @@
@warning_ignore_start("unsafe_method_access")
# GdUnit generated TestSuite
extends GdUnitTestSuite
var _handler :GdUnitCommandHandler
func before() -> void:
_handler = GdUnitCommandHandler.new()
func after() -> void:
_handler.free()
func test_command_shortcut() -> void:
assert_str(_handler.command_shortcut(GdUnitCommandInspectorRunTests.ID).get_as_text()).is_equal("Alt+F5")
assert_str(_handler.command_shortcut(GdUnitCommandInspectorDebugTests.ID).get_as_text()).is_equal("Alt+F6")
assert_str(_handler.command_shortcut(GdUnitCommandRunTestsOverall.ID).get_as_text()).is_equal("Alt+F7")
assert_str(_handler.command_shortcut(GdUnitCommandStopTestSession.ID).get_as_text()).is_equal("Alt+F8")
assert_str(_handler.command_shortcut(GdUnitCommandScriptEditorRunTests.ID).get_as_text()).is_equal("Ctrl+Alt+F5")
assert_str(_handler.command_shortcut(GdUnitCommandScriptEditorDebugTests.ID).get_as_text()).is_equal("Ctrl+Alt+F6")
assert_str(_handler.command_shortcut(GdUnitCommandScriptEditorCreateTest.ID).get_as_text()).is_equal("Ctrl+Alt+F10")
if Engine.get_version_info().hex >= 0x40600:
assert_str(_handler.command_shortcut(GdUnitCommandFileSystemRunTests.ID).get_as_text()).is_equal("Alt+Shift+F5")
assert_str(_handler.command_shortcut(GdUnitCommandFileSystemDebugTests.ID).get_as_text()).is_equal("Alt+Shift+F6")
else:
assert_str(_handler.command_shortcut(GdUnitCommandFileSystemRunTests.ID).get_as_text()).is_equal("Shift+Alt+F5")
assert_str(_handler.command_shortcut(GdUnitCommandFileSystemDebugTests.ID).get_as_text()).is_equal("Shift+Alt+F6")
## actually needs to comment out, it produces a lot of leaked instances
func _test__check_test_run_stopped_manually() -> void:
var inspector :GdUnitCommandHandler = mock(GdUnitCommandHandler, CALL_REAL_FUNC)
# simulate no test is running
do_return(false).on(inspector).is_test_running_but_stop_pressed()
inspector.check_test_run_stopped_manually()
verify(inspector, 0).cmd_stop(any_int())
# simulate the test runner was manually stopped by the editor
do_return(true).on(inspector).is_test_running_but_stop_pressed()
inspector.check_test_run_stopped_manually()
verify(inspector, 1).cmd_stop()
@@ -0,0 +1 @@
uid://grbqo22lpca6
@@ -0,0 +1,15 @@
# GdUnit generated TestSuite
class_name GdUnitShortcutTest
extends GdUnitTestSuite
@warning_ignore('unused_parameter')
@warning_ignore('return_value_discarded')
# TestSuite generated from
const __source: String = 'res://addons/gdUnit4/src/core/command/GdUnitShortcut.gd'
func test_default_keys() -> void:
match OS.get_name().to_lower():
'windows':
assert_array(GdUnitShortcut.default_keys(GdUnitShortcut.ShortCut.NONE)).is_empty()
assert_array(GdUnitShortcut.default_keys(GdUnitShortcut.ShortCut.RUN_TESTSUITE_DEBUG)).contains_exactly(Key.KEY_ALT, Key.KEY_SHIFT, Key.KEY_F6)
@@ -0,0 +1 @@
uid://cd2ijw315bdif