From c42bd0f68813acbb55d369850f2e9b618f6422fa Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Fri, 6 Nov 2026 15:02:47 +0100 Subject: [PATCH] fix: count the bundled names verify leaves out 'Bundled with their emulator, not collected: 154' listed the 14 required firmware names and nothing said the rest existed. The line now ends with '139 more, --verbose lists them', as the Core files line does. --- scripts/verify.py | 8 ++++++-- tests/test_verify_listing.py | 31 +++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/scripts/verify.py b/scripts/verify.py index d40377424..ebc06cee4 100644 --- a/scripts/verify.py +++ b/scripts/verify.py @@ -1921,10 +1921,14 @@ def _print_undeclared_section(result: dict, verbose: bool) -> None: u for u in bundled if u["required"] and u.get("category", "bios") != "game_data" ] - names = ", ".join(sorted({u["name"] for u in shown})) + named = sorted({u["name"] for u in shown}) + # The required firmware alone read as the whole count: 14 names + # for 154 entries, nothing saying the rest existed. + hidden = len({u["name"] for u in bundled}) - len(named) + listed = named + ([f"{hidden} more, --verbose lists them"] if hidden else []) print( f" Bundled with their emulator, not collected: {len(bundled)}" - + (f" ({names})" if names else "") + + (f" ({', '.join(listed)})" if listed else "") ) if unplaced: print(f" Core files held but not packed: {len(unplaced)} " diff --git a/tests/test_verify_listing.py b/tests/test_verify_listing.py index 00c43b592..809d9fa71 100644 --- a/tests/test_verify_listing.py +++ b/tests/test_verify_listing.py @@ -241,6 +241,37 @@ class BundledGameDataIsNotMissing(unittest.TestCase): out.getvalue()) +class TheBundledLineSaysWhatItLeavesOut(unittest.TestCase): + """'Bundled with their emulator, not collected: 154' listed 14 names, + the required firmware, and nothing said 140 more existed.""" + + def test_the_hidden_names_are_counted(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": name, "emulator": "e", "required": required, "in_repo": False, + "bundled": True, "in_pack": False} + for name, required in (("fw.bin", True), ("a.frag", False), ("b.dll", False)) + ]} + with contextlib.redirect_stdout(io.StringIO()) as quiet: + verify._print_undeclared_section(result, verbose=False) + self.assertIn( + "Bundled with their emulator, not collected: 3 " + "(fw.bin, 2 more, --verbose lists them)", + quiet.getvalue(), + ) + with contextlib.redirect_stdout(io.StringIO()) as verbose: + verify._print_undeclared_section(result, verbose=True) + self.assertIn( + "Bundled with their emulator, not collected: 3 (a.frag, b.dll, fw.bin)", + verbose.getvalue(), + ) + + class CoreCopiesWithoutAGapEntryAreCounted(unittest.TestCase): """verify --platform recalbox --system nec-pc-engine printed no Core files line while the pack held six geargrafx syscard copies: the gap