From 0ee71988450fe8d3f4973758fb72fefd2e7296ef Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Sat, 6 Apr 2024 13:13:27 +0200 Subject: [PATCH] Make unitbase.gd more verbose --- tests/unitbase.gd | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/unitbase.gd b/tests/unitbase.gd index 9d91fda..c6ea399 100644 --- a/tests/unitbase.gd +++ b/tests/unitbase.gd @@ -29,6 +29,8 @@ func after_each() -> void: # Framework management func load_framework(config: CoreConfiguration = CoreConfiguration.new()) -> void: + if is_framework_loaded(): await unload_framework() + ldiag("Loading framework") core = Core.new(config) get_tree().root.add_child(core) await get_tree().process_frame @@ -36,12 +38,16 @@ func load_framework(config: CoreConfiguration = CoreConfiguration.new()) -> void func unload_framework() -> void: if is_framework_loaded(): + ldiag("Unloading framework") await core.cleanup() get_tree().root.remove_child.call_deferred(core) core = null await get_tree().process_frame + else: lcrash("Can't unload framework: Framework is not loaded") func is_framework_loaded() -> bool: return get_node_or_null("/root/CORE") != null # Helper functions -func wait_process_time() -> void: await get_tree().create_timer(0.1).timeout +func wait_process_time() -> void: + ldiag("Waiting process time") + await get_tree().create_timer(0.1).timeout