From d37caecc27978f9b832a6ba1602750c24fdf43c0 Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Tue, 11 Aug 2026 16:06:20 +0200 Subject: [PATCH] test: cover slot naming and per-system extras --- tests/test_e2e.py | 30 ++++++++++++++++++++++++++++++ wiki/advanced-usage.md | 8 +++++--- 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/tests/test_e2e.py b/tests/test_e2e.py index 85d23e64..ab435822 100644 --- a/tests/test_e2e.py +++ b/tests/test_e2e.py @@ -5685,6 +5685,36 @@ struct BurnDriver BurnDrvneogeo = { ) self.assertTrue(checked.issubset(self._names_in(out))) + def test_extras_group_under_their_system_not_a_shared_bucket(self): + """find_undeclared_files reports the display name, the profiles are + keyed by slug; a key-only lookup put nearly every core extra in one + bucket and lost the per-system grouping both narrowing passes need.""" + from generate_pack import _emulator_systems_index + + index = _emulator_systems_index( + { + "beetle_psx": { + "emulator": "Beetle PSX (Mednafen PSX)", + "systems": ["sony-playstation"], + }, + "beebem": {"emulator": "beebem", "systems": ["bbc-micro-b"]}, + } + ) + self.assertEqual(index["beetle_psx"], ["sony-playstation"]) + self.assertEqual( + index["Beetle PSX (Mednafen PSX)"], ["sony-playstation"] + ) + self.assertEqual(index["beebem"], ["bbc-micro-b"]) + self.assertNotIn("_extras", index) + + def test_slot_narrowed_pack_gets_its_own_name(self): + names = { + os.path.basename(self._region_pack()), + os.path.basename(self._region_pack(one_per_slot=True)), + } + self.assertEqual(len(names), 2, names) + self.assertTrue(any("OnePerSlot" in n for n in names)) + def test_verify_pack_return_matches_its_annotation(self): import inspect import typing diff --git a/wiki/advanced-usage.md b/wiki/advanced-usage.md index 7ffd18c8..4f4aa95d 100644 --- a/wiki/advanced-usage.md +++ b/wiki/advanced-usage.md @@ -145,9 +145,11 @@ cannot be ordered, so the whole slot is left alone: the North American PlayStation slot stays open because `scph101.bin` carries no priority, even though `scph5501.bin` would otherwise win at 5. -`--one-per-slot` requires `--platform` or `--all`, and is refused with -`--manifest`, `--emulator`, `--system` and `--from-md5` rather than silently -ignored. +`--one-per-slot` works with or without `--region`, requires `--platform` or +`--all`, and is refused with `--manifest`, `--emulator`, `--system` and +`--from-md5` rather than silently ignored. It tags the output name +(`Recalbox_10.0.8_OnePerSlot_BIOS_Pack.zip`) so a narrowed build never +overwrites the full one, and the pack README says the pack was narrowed. `--region` composes with `--split`, `--target`, `--required-only`, `--source`,