diff --git a/emulators/mame2010.yml b/emulators/mame2010.yml index 26b15b78..6bdcea20 100644 --- a/emulators/mame2010.yml +++ b/emulators/mame2010.yml @@ -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. diff --git a/scripts/validate_schemas.py b/scripts/validate_schemas.py index 0346cee9..c968d30b 100644 --- a/scripts/validate_schemas.py +++ b/scripts/validate_schemas.py @@ -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 diff --git a/tests/test_mame_devices.py b/tests/test_mame_devices.py index 60898895..2e679f98 100644 --- a/tests/test_mame_devices.py +++ b/tests/test_mame_devices.py @@ -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):