extends SceneTree ## Session-shell smoke: boot the main scene, confirm the venue menu is showing, ## start a Joke Shop shift, open the pause overlay and settings, then return to ## the menu. Exits non-zero on failure. ## ## Usage: ## godot --headless --path . --script res://src/test/smoke_session_shell.gd ## godot --path . --script res://src/test/smoke_session_shell.gd (windowed) var _frames := 0 var _manager = null var _main = null func _initialize() -> void: var packed: PackedScene = load("res://scenes/main.tscn") if packed == null: printerr("cannot load main scene") quit(1) return _main = packed.instantiate() root.add_child(_main) print("boot: main scene added") func _process(_delta: float) -> bool: _frames += 1 if _frames == 10: _manager = _main.get_node_or_null("GameManager") if _manager.start_menu == null or not _manager.start_menu.visible: printerr("start menu not visible at boot") quit(1) return true print("boot: start menu visible") _manager._on_venue_selected("joke_shop") if _frames == 200: if _manager.npcs.size() == 0: printerr("no NPCs spawned after shift start") quit(1) return true print("boot: shift running, npcs=%d" % _manager.npcs.size()) _manager._open_pause() if _frames == 210: if _manager.pause_overlay == null or not _manager.pause_overlay.visible: printerr("pause overlay did not open") quit(1) return true print("boot: pause overlay visible") _manager._open_settings() if _frames == 220: if _manager.settings_panel == null or not _manager.settings_panel.visible: printerr("settings panel did not open") quit(1) return true print("boot: settings visible") _manager.settings_panel._on_cancel() _manager._quit_to_menu() if _frames == 230: if not _manager.start_menu.visible: printerr("quit-to-menu did not return to the start menu") quit(1) return true print("SMOKE PASS: menu -> shift -> pause -> settings -> menu") quit(0) return true return false