fix: type role libretro cores as libretro

2048 and gong (game), radio and video_processor (utility) and the test
cores (test) are libretro builds, but their role sat in type:, which
resolve_platform_cores filters on: all_libretro left them out, so no
platform resolved them and RetroArch's manifest named none, the
--installed-cores gap of issue 87. The role moves to role:, and type
stays libretro: type keeps saying how a profile is built and run, which
the resolver reads, while teaching the resolver that three role values
mean libretro would make type a classification again. The site and
coverage leave test cores out by role. fluidsynth, a library and no
libretro core, keeps type utility. A test keeps every buildbot core
named by RetroArch's resolution.
This commit is contained in:
Abdessamad Derraz committed 2026-11-09 23:01:22 +01:00
1 parent b4152f9aaf
commit 314b15b4ad
23 files changed
+104 -53

No files matched your search

+4 -4
View File
@@ -21,10 +21,10 @@ from common import load_emulator_profiles # noqa: E402
STEM_NAMED = {
# Template and test cores, no emulator page.
"00_example": "template",
"test": "type test",
"testgl": "type test",
"testvulkan": "type test",
"vidtest": "type test",
"test": "role test",
"testgl": "role test",
"testvulkan": "role test",
"vidtest": "role test",
# Aliases, no emulator page.
"ep128emu": "alias",
"mednafen_gba": "alias",
+1 -1
View File
@@ -30,7 +30,7 @@ class SiteCoreCounts(unittest.TestCase):
def test_each_platform_count_is_the_resolved_set(self):
platforms = str(REPO_ROOT / "platforms")
profiles = load_emulator_profiles(str(REPO_ROOT / "emulators"))
unique = {k: v for k, v in profiles.items() if v.get("type") not in ("alias", "test")}
unique = {k: v for k, v in profiles.items() if v.get("type") != "alias" and v.get("role") != "test"}
coverages = {}
for name in list_registered_platforms(platforms):
config = load_platform_config(name, platforms)
+3 -3
View File
@@ -499,7 +499,7 @@ class TheTemplateIsNoEmulator(unittest.TestCase):
self.assertNotIn("00_example", index)
self.assertIn("melonds.md", index)
# A test profile gets no page at all (generate_site's public_profiles).
self.assertEqual(_profile("00_example")["type"], "test")
self.assertEqual(_profile("00_example")["role"], "test")
@unittest.skipUnless((DIST / "emulators" / "aethersx2" / "index.html").is_file(), "site not built")
@@ -517,7 +517,7 @@ class TheBuiltEmulatorPages(unittest.TestCase):
self.assertNotIn("RetroArch", page.split("Install this emulator", 1)[1].split("</details>", 1)[0])
def test_the_index_leaves_the_template_out(self):
# 00_example is `type: test`: no page, no index row.
# 00_example has `role: test`: no page, no index row.
self.assertNotIn("00_example", self._html("emulators"))
self.assertIn('data-pagefind-body', self._html("emulators/melonds"))
self.assertFalse((DIST / "emulators" / "00_example").exists())
@@ -630,7 +630,7 @@ class DataFolderPrinted(unittest.TestCase):
if not _generated():
self.skipTest("site pages not generated")
for name, profile in _profiles_with_data_root().items():
if profile.get("type") in ("alias", "test"):
if profile.get("type") == "alias" or profile.get("role") == "test":
continue
page = _built_page(name)
with self.subTest(profile=name):
+1 -1
View File
@@ -55,7 +55,7 @@ class EngineIntros(unittest.TestCase):
def test_every_intro_names_what_it_emulates(self):
for path in sorted(glob.glob(str(REPO_ROOT / "emulators" / "*.yml"))):
profile = yaml.safe_load(Path(path).read_text(encoding="utf-8"))
if not isinstance(profile, dict) or profile.get("type") in ("alias", "test"):
if not isinstance(profile, dict) or profile.get("type") == "alias" or profile.get("role") == "test":
continue
name = Path(path).stem
with self.subTest(profile=name):
+1 -1
View File
@@ -747,7 +747,7 @@ class AnIdLeadsToItsData(unittest.TestCase):
"pcsx2": {"type": "standalone"},
"lrps2": {"type": "libretro", "cores": ["pcsx2"]},
"mednafen_psx_alias": {"type": "alias", "alias_of": "beetle_psx"},
"probe": {"type": "test", "cores": ["probe_core"]},
"probe": {"type": "libretro", "role": "test", "cores": ["probe_core"]},
}
items = generate_site.core_index_items(profiles)
by_name: dict[str, list[tuple[str, bool]]] = {}
+30
View File
@@ -21,6 +21,36 @@ sys.path.insert(0, str(REPO_ROOT / "scripts"))
from common import canonical_target_name # noqa: E402
class EveryBuildbotCoreIsNamed(unittest.TestCase):
"""A core RetroArch installs that its manifest does not name is "a core
this list does not know" to --installed-cores (issue 87). 2048, gong,
radio, video_processor and test were typed by their role, which hid
their libretro build from all_libretro."""
def test_retroarch_names_every_buildbot_core(self):
import yaml # noqa: PLC0415
from common import ( # noqa: PLC0415
load_emulator_profiles,
load_platform_config,
load_target_config,
resolve_platform_cores,
upstream_profile_index,
)
platforms = str(REPO_ROOT / "platforms")
profiles = load_emulator_profiles(str(REPO_ROOT / "emulators"))
runs = resolve_platform_cores(load_platform_config("retroarch", platforms), profiles)
index = upstream_profile_index(profiles, include_aliases=True)
targets = yaml.safe_load((REPO_ROOT / "platforms" / "targets" / "retroarch.yml").read_text())
names = {
name for target in targets["targets"]
for name in load_target_config("retroarch", target, platforms) or ()
}
unnamed = sorted(name for name in names if not (index.get(name, set()) & runs))
self.assertEqual(unnamed, [])
class AliasesResolveToOneName(unittest.TestCase):
def test_retroarch_switch_aliases(self):
platforms = str(REPO_ROOT / "platforms")