Add more log messages and cool banner

This commit is contained in:
JeremyStar™ 2024-04-07 21:58:40 +02:00
parent a422218139
commit a4d5eb2157
Signed by: JeremyStarTM
GPG key ID: E366BAEF67E4704D

View file

@ -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)