fix: count core archives among the core files

This commit is contained in:
Abdessamad Derraz committed 2026-10-06 09:54:33 +02:00
1 parent 204637cfeb
commit 3088db7088
2 files changed
+23 -1

No files matched your search

+4 -1
View File
@@ -1122,8 +1122,11 @@ def _print_undeclared_section(result: dict, verbose: bool) -> None:
if not undeclared:
return
bios_files = [u for u in undeclared if u.get("category", "bios") == "bios"]
# Everything that is not game data is firmware the core loads, archives
# included: a bios_zip sat in neither list, so a required one that was
# missing was never printed.
game_data = [u for u in undeclared if u.get("category", "bios") == "game_data"]
bios_files = [u for u in undeclared if u.get("category", "bios") != "game_data"]
req_not_in_repo = [
u
+19
View File
@@ -96,5 +96,24 @@ class EmulatorPackReadsThePlatformsDir(unittest.TestCase):
self.assertEqual(seen, ["elsewhere"])
class CoreArchivesAreCounted(unittest.TestCase):
def test_a_missing_required_bios_zip_is_printed(self):
import contextlib # noqa: PLC0415
import io # noqa: PLC0415
sys.path.insert(0, str(REPO_ROOT / "scripts"))
import verify # noqa: PLC0415
result = {"undeclared_files": [
{"name": "neogeo.zip", "category": "bios_zip", "required": True,
"in_repo": False, "emulator": "fbneo"},
]}
out = io.StringIO()
with contextlib.redirect_stdout(out):
verify._print_undeclared_section(result, verbose=False)
self.assertIn("1 required missing", out.getvalue())
self.assertIn("neogeo.zip", out.getvalue())
if __name__ == "__main__":
unittest.main()