mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-06 01:53:56 -06:00
fix: group regions by the target in pack integrity
This commit is contained in:
1 parent
64f84e7ca6
commit
c4a080b0f4
2 files changed
+28
No files matched your search
@@ -514,6 +514,7 @@ def verify_pack_against_platform(
|
|||||||
db,
|
db,
|
||||||
base_dest,
|
base_dest,
|
||||||
emu_profiles,
|
emu_profiles,
|
||||||
|
target_cores=target_cores,
|
||||||
)
|
)
|
||||||
region_drops = region_mod.resolve_region_drops(
|
region_drops = region_mod.resolve_region_drops(
|
||||||
region_groups, region_index, regions
|
region_groups, region_index, regions
|
||||||
|
|||||||
@@ -584,6 +584,33 @@ class TestReportAndBuilderNarrowTogether(unittest.TestCase):
|
|||||||
self.assertIn(kept, names, "a system with no candidate in the region falls back")
|
self.assertIn(kept, names, "a system with no candidate in the region falls back")
|
||||||
self.assertEqual(full["total_files"], narrowed["total_files"])
|
self.assertEqual(full["total_files"], narrowed["total_files"])
|
||||||
|
|
||||||
|
def test_every_grouping_call_carries_the_target(self):
|
||||||
|
"""Integrity grouped every core's extras while the builder grouped the target's.
|
||||||
|
|
||||||
|
Under --target with --region, a fallback the pack kept was withdrawn
|
||||||
|
from the check: 14 Batocera rk3568 files were never verified.
|
||||||
|
"""
|
||||||
|
import ast
|
||||||
|
|
||||||
|
scripts = Path(__file__).resolve().parent.parent / "scripts"
|
||||||
|
for path in sorted(scripts.rglob("*.py")):
|
||||||
|
tree = ast.parse(path.read_text(encoding="utf-8"))
|
||||||
|
for func in ast.walk(tree):
|
||||||
|
if not isinstance(func, (ast.FunctionDef, ast.AsyncFunctionDef)):
|
||||||
|
continue
|
||||||
|
params = {a.arg for a in func.args.args + func.args.kwonlyargs}
|
||||||
|
if "target_cores" not in params:
|
||||||
|
continue
|
||||||
|
for call in ast.walk(func):
|
||||||
|
if (
|
||||||
|
isinstance(call, ast.Call)
|
||||||
|
and getattr(call.func, "id", None) == "platform_region_groups"
|
||||||
|
):
|
||||||
|
with self.subTest(module=path.name, function=func.name):
|
||||||
|
self.assertIn(
|
||||||
|
"target_cores", {k.arg for k in call.keywords}
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
unittest.main()
|
unittest.main()
|
||||||
Reference in new issue
Block a user