From a4d5eb2157898e537aaf363a2b148064b36ad24d Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Sun, 7 Apr 2024 21:58:40 +0200 Subject: [PATCH] Add more log messages and cool banner --- addons/besseretests/src/runtimescene.gd | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/addons/besseretests/src/runtimescene.gd b/addons/besseretests/src/runtimescene.gd index e431406..a511c62 100644 --- a/addons/besseretests/src/runtimescene.gd +++ b/addons/besseretests/src/runtimescene.gd @@ -28,6 +28,13 @@ var crashed: bool = false # +++ initialization +++ # Startup function func _ready() -> void: + linfo(" ____ Made by StarOpenSource & Contributors ______ __") + linfo("/\\ _`\\ Licensed under the GNU AGPL v3 /\\__ _\\ /\\ \\__") + linfo("\\ \\ \\L\\ \\ __ ____ ____ __ _ __ __ \\/_/\\ \\/ __ ____\\ \\ ,_\\ ____") + linfo(" \\ \\ _ <' /'__`\\ /',__\\ /',__\\ /'__`\\/\\`'__\\/'__`\\ \\ \\ \\ /'__`\\ /',__\\\\ \\ \\/ /',__\\") + linfo(" \\ \\ \\L\\ \\/\\ __//\\__, `\\/\\__, `\\/\\ __/\\ \\ \\//\\ __/ \\ \\ \\/\\ __//\\__, `\\\\ \\ \\_/\\__, `\\") + linfo(" \\ \\____/\\ \\____\\/\\____/\\/\\____/\\ \\____\\\\ \\_\\\\ \\____\\ \\ \\_\\ \\____\\/\\____/ \\ \\__\\/\\____/") + linfo(" \\/___/ \\/____/\\/___/ \\/___/ \\/____/ \\/_/ \\/____/ \\/_/\\/____/\\/___/ \\/__/\\/___/") await get_tree().process_frame await load_config() @@ -49,6 +56,7 @@ func _ready() -> void: # Load configuration func load_config() -> void: + ldiag("Loading configuration") if FileAccess.file_exists(config_path): config.set_script(load(config_path)) for config_key in config_keys: @@ -59,6 +67,7 @@ func load_config() -> void: # Update window properties func update_window_properties() -> void: + ldiag("Updating window properties") DisplayServer.window_set_size(Vector2i(960, 540)) DisplayServer.window_set_title("Running tests") DisplayServer.window_set_vsync_mode(DisplayServer.VSYNC_ENABLED) @@ -240,12 +249,17 @@ func run_suite(suite: String) -> void: # Remove suite node get_tree().root.remove_child(suite_node) suite_node.queue_free() + # Terminates the engine func terminate(exit_code: int = 0) -> void: - config.queue_free() - check_children() - check_orphan_nodes() linfo("Shutting down...") + ldiag("Freeing config") + config.queue_free() + ldiag("Executing 'check_children'") + check_children() + ldiag("Executing 'check_orphan_nodes'") + check_orphan_nodes() + ldiag("Waiting for log messages to be flushed") await get_tree().create_timer(0.25).timeout queue_free() get_tree().quit(exit_code)