test: cover slot naming and per-system extras

This commit is contained in:
Abdessamad Derraz committed 2026-08-11 16:06:20 +02:00
1 parent 80ea7f5764
commit d37caecc27
2 files changed
+35 -3

No files matched your search

+30
View File
@@ -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
+5 -3
View File
@@ -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`,