Files
Fighting_Rthythm_game/tests/test_rhythm_scene.gd
2026-07-02 09:47:52 -07:00

37 lines
954 B
GDScript

extends SceneTree
var failures: Array[String] = []
func _init() -> void:
var scene: PackedScene = load("res://scenes/main/main.tscn")
if scene == null:
push_error("Could not load main.tscn")
quit(1)
return
var main := scene.instantiate()
if main.get_script() == null:
failures.append("Main script failed to load")
for node_path: String in ["Stage", "Stage/ActorsContainer/Player", "ChartRunner", "UI"]:
if not main.has_node(node_path):
failures.append("Missing required node: %s" % node_path)
if main.has_node("RhythmConductor"):
failures.append("RhythmConductor should be promoted to RhythmManager autoload")
if not ProjectSettings.has_setting("autoload/RhythmManager"):
failures.append("RhythmManager autoload should be configured")
main.free()
_finish()
func _finish() -> void:
if failures.is_empty():
print("PASS rhythm scene")
quit(0)
else:
for failure: String in failures:
push_error(failure)
quit(1)