fixed camera and sword animation issue and upgraded to Godot 4.6
Some checks failed
Create tag and build when new code gets to main / BumpTag (push) Successful in 22s
Create tag and build when new code gets to main / Test (push) Failing after 2m10s
Create tag and build when new code gets to main / Export (push) Has been skipped

This commit is contained in:
2026-01-27 17:47:19 +01:00
parent 056a68b0ad
commit caeae26a09
335 changed files with 3035 additions and 2221 deletions

View File

@@ -1 +1 @@
uid://r43u2usutiss
uid://bymqibokrfyuk

View File

@@ -1 +1 @@
uid://coauynw7rnsij
uid://bxkxeyj2jbth2

View File

@@ -40,22 +40,40 @@ static func input_event_as_text(event :InputEvent) -> String:
var text := ""
if event is InputEventKey:
var key_event := event as InputEventKey
text += "InputEventKey : key='%s', pressed=%s, keycode=%d, physical_keycode=%s" % [
event.as_text(), key_event.pressed, key_event.keycode, key_event.physical_keycode]
text += """
InputEventKey : keycode=%s (%s) pressed: %s
physical_keycode: %s
location: %s
echo: %s""" % [
key_event.keycode,
event.as_text_keycode(),
key_event.pressed,
key_event.physical_keycode,
key_event.location,
key_event.echo]
else:
text += event.as_text()
if event is InputEventMouse:
var mouse_event := event as InputEventMouse
text += ", global_position %s" % mouse_event.global_position
text += """
global_position: %s""" % mouse_event.global_position
if event is InputEventWithModifiers:
var mouse_event := event as InputEventWithModifiers
text += ", shift=%s, alt=%s, control=%s, meta=%s, command=%s" % [
text += """
--------
mods: %s
shift: %s
alt: %s
control: %s
meta: %s
command: %s""" % [
mouse_event.get_modifiers_mask(),
mouse_event.shift_pressed,
mouse_event.alt_pressed,
mouse_event.ctrl_pressed,
mouse_event.meta_pressed,
mouse_event.command_or_control_autoremap]
return text
return text.dedent()
static func _colored_string_div(characters: String) -> String:
@@ -119,6 +137,10 @@ static func _nerror(number :Variant) -> String:
return "[color=%s]%s[/color]" % [ERROR_COLOR, str(number)]
static func _colored(value: Variant, color: Color) -> String:
return "[color=%s]%s[/color]" % [color.to_html(), value]
static func _colored_value(value :Variant) -> String:
match typeof(value):
TYPE_STRING, TYPE_STRING_NAME:
@@ -161,19 +183,53 @@ static func _index_report_as_table(index_reports :Array) -> String:
return table.replace("$cells", cells)
static func orphan_detected_on_suite_setup(count :int) -> String:
return "%s\n Detected <%d> orphan nodes during test suite setup stage! [b]Check before() and after()![/b]" % [
_warning("WARNING:"), count]
static func orphan_warning(orphans_count: int) -> String:
return """
%s: Found %s possible orphan nodes.
Add %s to the end of the test to collect details.""".dedent().trim_prefix("\n") % [
_warning("WARNING:"),
_nerror(orphans_count),
_colored_value("collect_orphan_node_details()")
]
static func orphan_detected_on_suite_setup(orphans: Array[GdUnitOrphanNodeInfo]) -> String:
return """
%s Detected %s orphan nodes!
[b]Verify your test suite setup.[/b]
%s""".dedent().trim_prefix("\n") % [
_warning("WARNING:"),
_nerror(orphans.size()),
_build_orphan_node_stacktrace(orphans)]
static func orphan_detected_on_test_setup(count :int) -> String:
return "%s\n Detected <%d> orphan nodes during test setup! [b]Check before_test() and after_test()![/b]" % [
_warning("WARNING:"), count]
static func orphan_detected_on_test_setup(orphans: Array[GdUnitOrphanNodeInfo]) -> String:
return """
%s Detected %s orphan nodes on test setup!
[b]Check before_test() and after_test()![/b]
%s""".dedent().trim_prefix("\n") % [
_warning("WARNING:"),
_nerror(orphans.size()),
_build_orphan_node_stacktrace(orphans)
]
static func orphan_detected_on_test(count :int) -> String:
return "%s\n Detected <%d> orphan nodes during test execution!" % [
_warning("WARNING:"), count]
static func orphan_detected_on_test(orphans: Array[GdUnitOrphanNodeInfo]) -> String:
return """
%s Detected %s orphan nodes!
%s""".dedent().trim_prefix("\n") % [
_warning("WARNING:"),
_nerror(orphans.size()),
_build_orphan_node_stacktrace(orphans)
]
static func _build_orphan_node_stacktrace(orphans: Array[GdUnitOrphanNodeInfo]) -> String:
var stack_trace := "\n"
for orphan in orphans:
stack_trace += orphan.as_trace(orphan, true) + "\n"
return stack_trace.indent(" ")
static func fuzzer_interuped(iterations: int, error: String) -> String:
@@ -188,6 +244,10 @@ static func test_timeout(timeout :int) -> String:
return "%s\n %s" % [_error("Timeout !"), _colored_value("Test timed out after %s" % LocalTime.elapsed(timeout))]
static func test_session_terminated() -> String:
return "%s" % _error("Test Session Terminated")
# gdlint:disable = mixed-tabs-and-spaces
static func test_suite_skipped(hint :String, skip_count :int) -> String:
return """

View File

@@ -1 +1 @@
uid://vl7cfc01g5wl
uid://c178wdncle4i5

View File

@@ -1 +1 @@
uid://brxvavm3ml0om
uid://5fthlxduiurg

View File

@@ -75,7 +75,7 @@ func _toPackedStringArray(value: Variant) -> PackedStringArray:
return PackedStringArray([str(value)])
func _array_equals_div(current: Variant, expected: Variant, case_sensitive: bool = false) -> Array[Array]:
func _array_equals_div(current: Variant, expected: Variant, case_sensitive: bool = false) -> Array:
var current_value := _toPackedStringArray(current)
var expected_value := _toPackedStringArray(expected)
var index_report := Array()
@@ -374,24 +374,12 @@ func extractv(...extractors: Array) -> GdUnitArrayAssert:
_current_value_provider = DefaultValueProvider.new(null)
else:
for element: Variant in current:
var ev: Array[Variant] = [
GdUnitTuple.NO_ARG,
GdUnitTuple.NO_ARG,
GdUnitTuple.NO_ARG,
GdUnitTuple.NO_ARG,
GdUnitTuple.NO_ARG,
GdUnitTuple.NO_ARG,
GdUnitTuple.NO_ARG,
GdUnitTuple.NO_ARG,
GdUnitTuple.NO_ARG,
GdUnitTuple.NO_ARG
]
var ev: Array[Variant] = []
for index: int in extractors.size():
var extractor: GdUnitValueExtractor = extractors[index]
ev[index] = extractor.extract_value(element)
ev.append(extractor.extract_value(element))
if extractors.size() > 1:
extracted_elements.append(GdUnitTuple.new(ev[0], ev[1], ev[2], ev[3], ev[4], ev[5], ev[6], ev[7], ev[8], ev[9]))
extracted_elements.append(GdUnitTuple.new.callv(ev))
else:
extracted_elements.append(ev[0])
_current_value_provider = DefaultValueProvider.new(extracted_elements)

View File

@@ -1 +1 @@
uid://bx7cehfdh2x4w
uid://381c6r7r5uhp

View File

@@ -1 +1 @@
uid://cq38mcld2thyl
uid://8c05oepulju5

View File

@@ -1 +1 @@
uid://61d7pdgldg0r
uid://crrhhudfmy3ay

View File

@@ -1 +1 @@
uid://cxndss6mdq7de
uid://c310wp8sog1ti

View File

@@ -1 +1 @@
uid://dqrp7csbeyvon
uid://diqntuiv0y7pg

View File

@@ -1 +1 @@
uid://cbrj7dsr235i0
uid://b8htynygoyy0f

View File

@@ -1 +1 @@
uid://2s6h0titid8y
uid://dg0uusgasnr64

View File

@@ -1 +1 @@
uid://dvce6xeybbh1i
uid://fyb32t5gwdxk

View File

@@ -1 +1 @@
uid://c2jdw0vv5nldq
uid://bd15pn72awek1

View File

@@ -4,6 +4,7 @@ var _current_failure_message := ""
var _custom_failure_message := ""
var _additional_failure_message := ""
var _callable: Callable
var _logger := GodotGdErrorMonitor.new()
func _init(callable: Callable) -> void:
@@ -14,17 +15,10 @@ func _init(callable: Callable) -> void:
func _execute() -> Array[ErrorLogEntry]:
# execute the given code and monitor for runtime errors
if _callable == null or not _callable.is_valid():
@warning_ignore("return_value_discarded")
_report_error("Invalid Callable '%s'" % _callable)
else:
await _callable.call()
return await _error_monitor().scan(true)
func _error_monitor() -> GodotGdErrorMonitor:
return GdUnitThreadManager.get_current_context().get_execution_context().error_monitor
_logger.start()
await _callable.call()
_logger.stop()
return _logger.log_entries()
func failure_message() -> String:
@@ -46,8 +40,6 @@ func _report_error(error_message: String, failure_line_number: int = -1) -> GdUn
func _has_log_entry(log_entries: Array[ErrorLogEntry], type: ErrorLogEntry.TYPE, error: Variant) -> bool:
for entry in log_entries:
if entry._type == type and GdObjects.equals(entry._message, error):
# Erase the log entry we already handled it by this assertion, otherwise it will report at twice
_error_monitor().erase_log_entry(entry)
return true
return false
@@ -55,12 +47,11 @@ func _has_log_entry(log_entries: Array[ErrorLogEntry], type: ErrorLogEntry.TYPE,
func _to_list(log_entries: Array[ErrorLogEntry]) -> String:
if log_entries.is_empty():
return "no errors"
if log_entries.size() == 1:
return log_entries[0]._message
var value := ""
var values := []
for entry in log_entries:
value += "'%s'\n" % entry._message
return value
values.append(entry)
return "\n".join(values)
func is_null() -> GdUnitGodotErrorAssert:
@@ -90,6 +81,9 @@ func append_failure_message(message: String) -> GdUnitGodotErrorAssert:
func is_success() -> GdUnitGodotErrorAssert:
if not _validate_callable():
return self
var log_entries := await _execute()
if log_entries.is_empty():
return _report_success()
@@ -100,6 +94,9 @@ func is_success() -> GdUnitGodotErrorAssert:
func is_runtime_error(expected_error: Variant) -> GdUnitGodotErrorAssert:
if not _validate_callable():
return self
var result := GdUnitArgumentMatchers.is_variant_string_matching(expected_error)
if result.is_error():
return _report_error(result.error_message())
@@ -108,12 +105,15 @@ func is_runtime_error(expected_error: Variant) -> GdUnitGodotErrorAssert:
return _report_success()
return _report_error("""
Expecting: a runtime error is triggered.
message: '%s'
found: %s
expected: '%s'
current: '%s'
""".dedent().trim_prefix("\n") % [expected_error, _to_list(log_entries)])
func is_push_warning(expected_warning: Variant) -> GdUnitGodotErrorAssert:
if not _validate_callable():
return self
var result := GdUnitArgumentMatchers.is_variant_string_matching(expected_warning)
if result.is_error():
return _report_error(result.error_message())
@@ -122,12 +122,15 @@ func is_push_warning(expected_warning: Variant) -> GdUnitGodotErrorAssert:
return _report_success()
return _report_error("""
Expecting: push_warning() is called.
message: '%s'
found: %s
expected: '%s'
current: '%s'
""".dedent().trim_prefix("\n") % [expected_warning, _to_list(log_entries)])
func is_push_error(expected_error: Variant) -> GdUnitGodotErrorAssert:
if not _validate_callable():
return self
var result := GdUnitArgumentMatchers.is_variant_string_matching(expected_error)
if result.is_error():
return _report_error(result.error_message())
@@ -136,6 +139,14 @@ func is_push_error(expected_error: Variant) -> GdUnitGodotErrorAssert:
return _report_success()
return _report_error("""
Expecting: push_error() is called.
message: '%s'
found: %s
expected: '%s'
current: '%s'
""".dedent().trim_prefix("\n") % [expected_error, _to_list(log_entries)])
func _validate_callable() -> bool:
if _callable == null or not _callable.is_valid():
@warning_ignore("return_value_discarded")
_report_error("Invalid Callable '%s'" % _callable)
return false
return true

View File

@@ -1 +1 @@
uid://cyi6ooahncq7q
uid://d3st26kcndm8l

View File

@@ -1 +1 @@
uid://j4mpmwm2hw61
uid://bcuh7lnvrg7mb

View File

@@ -1 +1 @@
uid://bm6qm58a0dacq
uid://ba515a8xk0ubo

View File

@@ -1 +1 @@
uid://b0dlq6jyjcvps
uid://dwl5ooagjg2nc

View File

@@ -91,7 +91,11 @@ func is_not_equal(_expected: Variant) -> GdUnitSignalAssert:
# Verifies the signal exists checked the emitter
func is_signal_exists(signal_name :String) -> GdUnitSignalAssert:
func is_signal_exists(signal_name: Variant) -> GdUnitSignalAssert:
if not (signal_name is String or signal_name is Signal):
return report_error("Invalid signal_name: expected String or Signal, but is '%s'" % type_string(typeof(signal_name)))
signal_name = (signal_name as Signal).get_name() if signal_name is Signal else signal_name
if not _emitter.has_signal(signal_name):
@warning_ignore("return_value_discarded")
report_error("The signal '%s' not exists checked object '%s'." % [signal_name, _emitter.get_class()])
@@ -99,20 +103,36 @@ func is_signal_exists(signal_name :String) -> GdUnitSignalAssert:
# Verifies that given signal is emitted until waiting time
func is_emitted(name :String, args := []) -> GdUnitSignalAssert:
func is_emitted(signal_name: Variant, ...signal_args: Array) -> GdUnitSignalAssert:
_line_number = GdUnitAssertions.get_line_number()
return await _wail_until_signal(name, args, false)
return await _wail_until_signal(
signal_name,
_wrap_arguments.callv(signal_args),
false)
# Verifies that given signal is NOT emitted until waiting time
func is_not_emitted(name :String, args := []) -> GdUnitSignalAssert:
func is_not_emitted(signal_name: Variant, ...signal_args: Array) -> GdUnitSignalAssert:
_line_number = GdUnitAssertions.get_line_number()
return await _wail_until_signal(name, args, true)
return await _wail_until_signal(
signal_name,
_wrap_arguments.callv(signal_args),
true)
func _wail_until_signal(signal_name :String, expected_args :Array, expect_not_emitted: bool) -> GdUnitSignalAssert:
func _wrap_arguments(...args: Array) -> Array:
# Check using old syntax
if not args.is_empty() and args[0] is Array:
return args[0]
return args
func _wail_until_signal(signal_value: Variant, expected_args: Array, expect_not_emitted: bool) -> GdUnitSignalAssert:
if _emitter == null:
return report_error("Can't wait for signal checked a NULL object.")
if not (signal_value is String or signal_value is Signal):
return report_error("Invalid signal_name: expected String or Signal, but is '%s'" % type_string(typeof(signal_value)))
var signal_name := (signal_value as Signal).get_name() if signal_value is Signal else signal_value
# first verify the signal is defined
if not _emitter.has_signal(signal_name):
return report_error("Can't wait for non-existion signal '%s' checked object '%s'." % [signal_name,_emitter.get_class()])

View File

@@ -1 +1 @@
uid://dlh37yc086vr5
uid://c3ytdhnam8ba7

View File

@@ -1 +1 @@
uid://dxqvilchqqeta
uid://cw5h1gecccd37

View File

@@ -1 +1 @@
uid://r4avfcakvscw
uid://pyvt1oi43853

View File

@@ -1 +1 @@
uid://8y15b6ts3kss
uid://beueufp3wgjw8