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.
This commit is contained in:
Abdessamad Derraz committed 2026-11-06 15:02:47 +01:00
1 parent 1834d20dc9
commit c42bd0f688
2 files changed
+37 -2

No files matched your search

+6 -2
View File
@@ -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)} "
+31
View File
@@ -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