From a8b9853474346f233bcdc4ae2f9c9590055adaa2 Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Mon, 9 Nov 2026 23:30:12 +0100 Subject: [PATCH] fix: guard openmsx roms on its user folder layout The test's premise was stale, not the profile: openmsx.yml now writes share/systemroms below openMSX's user folder, the file pool's first place, and each platform's binding moves it. The test keeps guarding the same thing: every entry under share/systemroms, and on RetroBat, which sets OPENMSX_HOME to bios/openmsx, placed in the openMSX/share/systemroms folder its own list declares. --- tests/test_audit_regressions.py | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/tests/test_audit_regressions.py b/tests/test_audit_regressions.py index 9cdf78a03..b153efffc 100644 --- a/tests/test_audit_regressions.py +++ b/tests/test_audit_regressions.py @@ -4223,11 +4223,21 @@ class VerifyStrictAppliesInEveryMode(unittest.TestCase): class OpenMsxRomsSitInItsSystemroms(unittest.TestCase): """openMSX entries had no path and landed at the BIOS root, where no - frontend points FilePool. RetroBat declares its ROMs under - openMSX/share/systemroms, and the profile's paths must agree.""" + frontend points FilePool. The profile writes share/systemroms below + openMSX's user folder, the pool's first place (src/file/FilePool.cc, + FileOperations.cc), and RetroBat, which sets OPENMSX_HOME to + bios/openmsx and declares its ROMs under openMSX/share/systemroms, gets + them there.""" def test_every_entry_is_under_share_systemroms(self): - profile = yaml.safe_load((ROOT / "emulators" / "openmsx.yml").read_text()) + from scripts.common import ( # noqa: PLC0415 + load_emulator_profiles, + load_platform_config, + platform_layouts, + standalone_set, + ) + + profile = load_emulator_profiles(str(ROOT / "emulators"))["openmsx"] retrobat = yaml.safe_load((ROOT / "platforms" / "retrobat.yml").read_text()) declared_dirs = { fe["destination"].rsplit("/", 1)[0].lower() @@ -4236,12 +4246,15 @@ class OpenMsxRomsSitInItsSystemroms(unittest.TestCase): if "systemroms" in fe.get("destination", "") } self.assertEqual(declared_dirs, {"openmsx/share/systemroms"}) + config = load_platform_config("retrobat", str(ROOT / "platforms")) + ((view, _standalone),) = platform_layouts("openmsx", profile, standalone_set(config)) + placed = {f["name"]: f for f in view["files"]} for entry in profile["files"]: with self.subTest(name=entry["name"]): - self.assertEqual( - entry.get("path", "").lower(), - f"openmsx/share/systemroms/{entry['name']}".lower(), - ) + self.assertEqual(entry.get("path", "").lower(), + f"share/systemroms/{entry['name']}".lower()) + self.assertEqual(placed[entry["name"]].get("standalone_path", "").lower(), + f"openmsx/share/systemroms/{entry['name']}".lower()) class ASameNamedMemberIsNotTheFile(unittest.TestCase):