From bb339a614d06525f33f98acb8eddd17e30fc80d2 Mon Sep 17 00:00:00 2001 From: Valiantsin Dzerakh Date: Tue, 10 Nov 2026 23:08:43 +0300 Subject: [PATCH] Import at the top of tests/run_all.py and list cheats_vm_check json, shutil and tomllib were imported inside the functions that use them. cheats_vm_check came into dev after the table was written; it compiles runtime/cheats.c with clang like mouse_direct_check, so it takes the same cc need. Co-Authored-By: Claude Opus 5.5 --- tests/run_all.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/run_all.py b/tests/run_all.py index 96f2a007..1e218473 100644 --- a/tests/run_all.py +++ b/tests/run_all.py @@ -16,10 +16,13 @@ No third-party imports: this runs before any venv is trusted. """ import argparse +import json import os +import shutil import subprocess import sys import time +import tomllib from pathlib import Path ROOT = Path(__file__).resolve().parents[1] @@ -54,6 +57,7 @@ TESTS = { 'exefs_patches_test': ('.venv', None, [], ''), 'settings_doc_check': ('.venv', None, [], ''), 'mouse_direct_check': ('.venv', 'cc', ['--cc', ''], 'compiles its checks with clang'), + 'cheats_vm_check': ('.venv', 'cc', ['--cc', ''], 'compiles runtime/cheats.c into a harness with clang'), 'diff/atomic': ('.venv', None, [], ''), 'diff/simd': ('.venv', None, [], ''), # ---- read the game or a build ---- @@ -78,7 +82,6 @@ def load_work_dir(): if not cfg.exists(): return ROOT / 'build' try: - import tomllib with open(cfg, 'rb') as f: d = tomllib.load(f).get('work', {}).get('dir') return Path(d) if d else ROOT / 'build' @@ -110,7 +113,6 @@ def find_romfs(): gui = ROOT / 'build' / 'build_gui.json' # the GUI builder remembers where it built from if gui.exists(): try: - import json r = json.loads(gui.read_text(encoding='utf-8')).get('romfs') if r: cands.append(Path(r)) @@ -134,7 +136,6 @@ def find_cc(): c = MSYS_BIN / 'clang.exe' if WIN and c.exists(): return c - import shutil w = shutil.which('clang') return Path(w) if w else None