mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-06 01:53:56 -06:00
fix: system report reads the claims the pack reads
This commit is contained in:
1 parent
1ed605969d
commit
a82e9b6f7f
2 files changed
+36
-2
No files matched your search
+10
-2
@@ -1552,11 +1552,19 @@ def extras_for_systems(extras: list[dict], system_ids: list[str]) -> list[dict]:
|
||||
|
||||
|
||||
def report_owned_by_systems(report: list[dict], system_ids: list[str]) -> list[dict]:
|
||||
"""Gap report entries whose extra a pack built with --system carries."""
|
||||
"""Gap report entries whose extra a pack built with --system carries.
|
||||
|
||||
The other cores whose claim rides on the entry count, as the builder
|
||||
counts them: MAME 2009's taitofx1.zip went into a --system
|
||||
panasonic-3do pack for MAME 2016 and was missing from the report.
|
||||
"""
|
||||
def owner(entry: dict) -> dict:
|
||||
return {"source_system": entry.get("system"), "source_systems": entry.get("systems", [])}
|
||||
|
||||
return [
|
||||
u for u in report
|
||||
if extras_for_systems(
|
||||
[{"source_system": u.get("system"), "source_systems": u.get("systems", [])}],
|
||||
[{**owner(u), "other_claims": [owner(c) for c in u.get("other_claims", [])]}],
|
||||
system_ids,
|
||||
)
|
||||
]
|
||||
|
||||
@@ -404,6 +404,32 @@ class AMissingInputFileIsNamed(unittest.TestCase):
|
||||
self._refused(argv, "ERROR: Registry not found: nosuch.yml")
|
||||
|
||||
|
||||
class ASystemReportCountsTheClaimsThePackCounts(unittest.TestCase):
|
||||
"""`--platform retroarch --system panasonic-3do` packed MAME 2009's
|
||||
taitofx1.zip, which MAME 2016 claims for that system, and the report's
|
||||
core coverage did not name it: the builder read other_claims, verify
|
||||
read only the entry's own system."""
|
||||
|
||||
def test_a_claim_riding_on_an_entry_selects_it(self):
|
||||
from packextras import extras_for_systems, report_owned_by_systems
|
||||
|
||||
entry = {
|
||||
"name": "taitofx1.zip", "system": "arcade", "systems": ["arcade"],
|
||||
"other_claims": [{"name": "taitofx1.zip", "system": None,
|
||||
"systems": ["arcade", "panasonic-3do"]}],
|
||||
}
|
||||
extra = {"source_system": "arcade", "source_systems": ["arcade"],
|
||||
"other_claims": [{"source_system": None,
|
||||
"source_systems": ["arcade", "panasonic-3do"]}]}
|
||||
for system in ("panasonic-3do", "arcade", "sony-playstation"):
|
||||
with self.subTest(system=system):
|
||||
self.assertEqual(
|
||||
bool(report_owned_by_systems([entry], [system])),
|
||||
bool(extras_for_systems([extra], [system])),
|
||||
)
|
||||
self.assertEqual(report_owned_by_systems([entry], ["panasonic-3do"]), [entry])
|
||||
|
||||
|
||||
class StrictVerifyFailsOnACriticalMiss(unittest.TestCase):
|
||||
"""verify exited 0 with a required file missing on an md5 platform, so
|
||||
the pipeline printed "verify OK" over a pack the frontend rejects."""
|
||||
|
||||
Reference in new issue
Block a user