fix: check an entry's system: against its profile

The semantic check read systems: only. mame2010 filed seven BIOS root
sets under systems its list lacked: cpzn1, cpzn2 (zn.c:4543, 4563),
konamigv (konamigv.c:877), skns (suprnova.c:1686), alg_bios (alg.c:782),
maxaflex (maxaflex.c:541) and hng64 (hng64.c:2189) are GAME_IS_BIOS_ROOT
in mame2010-libretro at source_commit.
This commit is contained in:
Abdessamad Derraz committed 2026-10-21 12:06:06 +02:00
1 parent d49fcfd59e
commit 7ac96f2b39
3 files changed
+21 -4

No files matched your search

+7
View File
@@ -58,6 +58,13 @@ systems:
- imax-macs
- arcade
- barcrest-mpu4
- capcom-zn1
- capcom-zn2
- konami-gv
- super-kaneko-nova
- alg-laserdisc
- exidy-maxaflex
- hyper-neogeo64
notes: |
Frozen snapshot of MAME 0.139 (mid-2010). Sourced from mame0139s.zip.
+5 -3
View File
@@ -74,7 +74,7 @@ _CHECK_FIELDS = {
def _systems_outside_profile(path: Path, document: object) -> list[str]:
"""An entry's systems: naming a system its profile does not list.
"""An entry's system: or systems: naming a system its profile does not list.
A --system pick selects the profile by its systems: and then the entry
by its own, so a name the profile lacks is one no pick ever reaches.
@@ -86,11 +86,13 @@ def _systems_outside_profile(path: Path, document: object) -> list[str]:
for index, entry in enumerate(document.get("files") or []):
if not isinstance(entry, dict):
continue
unknown = [str(s) for s in entry.get("systems") or [] if str(s) not in listed]
named = [entry["system"]] if entry.get("system") else []
named += list(entry.get("systems") or [])
unknown = [str(s) for s in named if str(s) not in listed]
if unknown:
out.append(
f"{path.relative_to(ROOT)}: files[{index}] ({entry.get('name')}) "
f"systems {', '.join(unknown)} not in the profile's systems"
f"system {', '.join(unknown)} not in the profile's systems"
)
return out
+9 -1
View File
@@ -622,7 +622,15 @@ class APickReadsTheEntrySystems(unittest.TestCase):
outside = {**base, "files": [{"name": "x.zip", "systems": ["a", "c"]}]}
found = validate_schemas._systems_outside_profile(root / "emulators" / "x.yml", outside)
self.assertEqual(len(found), 1)
self.assertIn("systems c", found[0])
self.assertIn("system c", found[0])
single = {**base, "files": [{"name": "x.zip", "system": "c"}]}
found = validate_schemas._systems_outside_profile(root / "emulators" / "x.yml", single)
self.assertEqual(len(found), 1)
self.assertIn("system c", found[0])
listed = {**base, "files": [{"name": "x.zip", "system": "a"}]}
self.assertEqual(
validate_schemas._systems_outside_profile(root / "emulators" / "x.yml", listed), []
)
class Cli(unittest.TestCase):