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 @@
## A fuzzer that generates random Vector2 values within a specified rectangular range.[br]
##
## This is particularly useful for testing 2D physics, movement
## systems, UI positioning, sprite coordinates, or any code that processes 2D vectors.[br]
##
## The fuzzer generates vectors where each component (x, y) is independently randomized
## within its respective range, creating a uniform distribution over the rectangular area.[br]
##
## [b]Usage example:[/b]
## [codeblock]
## # Test 2D movement within screen bounds
## func test_movement(fuzzer := Vector2Fuzzer.new(Vector2.ZERO, Vector2(1920, 1080)), _fuzzer_iterations := 200) -> void:
## var position := fuzzer.next_value()
## player.set_position(position)
##
## [/codeblock]
class_name Vector2Fuzzer
extends Fuzzer
## Minimum bounds for the generated vectors (inclusive for both x and y).
var _from: Vector2
## Maximum bounds for the generated vectors (inclusive for both x and y).
var _to: Vector2
func _init(from: Vector2, to: Vector2) -> void:
assert(from <= to, "Invalid range!")
_from = from
_to = to
## Generates a random Vector2 within the configured rectangular range.[br]
##
## Returns a Vector2 where each component is independently randomized:[br]
## - x: random float between [code]_from.x[/code] and [code]_to.x[/code][br]
## - y: random float between [code]_from.y[/code] and [code]_to.y[/code][br]
##
## The distribution is uniform over the rectangular area defined by the bounds.[br]
##
## @returns A random Vector2 within the specified range.
func next_value() -> Vector2:
var x := randf_range(_from.x, _to.x)
var y := randf_range(_from.y, _to.y)
return Vector2(x, y)