diff --git a/tools/lan_e2e.py b/tools/lan_e2e.py index 1a0b25a9d..69a22fe48 100755 --- a/tools/lan_e2e.py +++ b/tools/lan_e2e.py @@ -274,8 +274,8 @@ both sides go to --out (host-*.png, guest-*.png). python3 tools/lan_e2e.py --check chest --check tab python3 tools/lan_e2e.py --server-thread --check portals # the host's world on its server thread -Needs the prepared resources in .local/horizon-client and, on Linux, vscreen (the desktop); on -macOS both games render offscreen. Games started here have no audio (HORIZON_NO_AUDIO=1). +Needs the prepared resources in .local/horizon-client. On Linux the games run on vscreen (the +desktop), or headless (offscreen, no pause) where there is none; on macOS both games render offscreen. Games started here have no audio (HORIZON_NO_AUDIO=1). """ import argparse import json @@ -4989,9 +4989,11 @@ def run(ctl, out, resources, checks): host, guest = Game('host', ctl, resources), Game('guest', ctl, resources) # Either way explicitly: the game's default is the server thread. host.d.env['HORIZON_SERVER_THREAD'] = '1' if SERVER_THREAD else '0' - # A headless run (HORIZON_E2E_HEADLESS) has no focused window to draw in: the games render - # offscreen and never pause on the focus loss, or the world would stand still. - headless = bool(os.environ.get('HORIZON_E2E_HEADLESS')) + # A headless run (HORIZON_E2E_HEADLESS, or a Linux without vscreen) has no focused window to draw + # in: the games render offscreen and never pause on the focus loss, or the world would stand still + # (a host paused before its world loads waits at "Connecting to the server..." for ever). + headless = bool(os.environ.get('HORIZON_E2E_HEADLESS')) or ( + sys.platform.startswith('linux') and not shutil.which('vscreen')) launch = ['launch'] if headless or sys.platform == 'darwin': launch.append('--offscreen') diff --git a/tools/test_save_roundtrip_parity.py b/tools/test_save_roundtrip_parity.py index 7b3c72e92..2390e2bfc 100644 --- a/tools/test_save_roundtrip_parity.py +++ b/tools/test_save_roundtrip_parity.py @@ -347,7 +347,8 @@ def horizon_resave(source, destination, bin_dir): socket = Path(tempfile.mkdtemp(prefix='hzrt')) / 'control.sock' # sockets need short paths ctl = [str(bin_dir / 'horizon-ctl'), '--socket', str(socket)] extra = [] - if sys.platform == 'darwin': + # Offscreen on macOS, and on a Linux without vscreen (never a window on a real monitor). + if sys.platform == 'darwin' or not shutil.which('vscreen'): env = lab.game_env() extra = ['--offscreen'] else: diff --git a/tools/test_world_reopen_parity.py b/tools/test_world_reopen_parity.py index 9487fd1b7..9c06c257c 100644 --- a/tools/test_world_reopen_parity.py +++ b/tools/test_world_reopen_parity.py @@ -34,9 +34,10 @@ CYCLES = 3 def game_env(): - """macOS renders offscreen; Linux uses the virtual screen (as test_save_roundtrip_parity).""" + """macOS renders offscreen; Linux uses the virtual screen (as test_save_roundtrip_parity), or renders + offscreen too where there is no vscreen.""" env = lab.game_env() - if sys.platform == 'darwin': + if sys.platform == 'darwin' or not shutil.which('vscreen'): return env, ['--offscreen'] subprocess.run(['vscreen', 'up'], check=False, capture_output=True) text = subprocess.run(['vscreen', 'env'], capture_output=True, text=True, check=True).stdout