mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-19 16:17:49 -06:00
chore: merge integ board rule
This commit is contained in:
commit
96faec98a4
28 files changed
+2525
-844
No files matched your search
@@ -284,7 +284,10 @@ class TheExportKeepsTheirShape(unittest.TestCase):
|
||||
|
||||
class TheCommittedListsAgree(unittest.TestCase):
|
||||
"""A system's cores are a part of the platform's: a name only the system
|
||||
carries would escape every reader of the platform list."""
|
||||
carries would escape every reader of the platform list. A system keeps
|
||||
the list its ES file writes, which says whose files its entries ask for,
|
||||
so the one name it may carry beyond the platform's is one no device
|
||||
image builds (EmuELEC's VVVVVV port engine, KNULLI's duckstation)."""
|
||||
|
||||
def test_system_cores_are_platform_cores(self):
|
||||
import yaml
|
||||
@@ -292,10 +295,14 @@ class TheCommittedListsAgree(unittest.TestCase):
|
||||
for name in ("amberelec", "emuelec", "knulli"):
|
||||
with self.subTest(platform=name):
|
||||
config = yaml.safe_load((REPO_ROOT / "platforms" / f"{name}.yml").read_text())
|
||||
targets = yaml.safe_load(
|
||||
(REPO_ROOT / "platforms" / "targets" / f"{name}.yml").read_text())["targets"]
|
||||
built = {c for entry in targets.values() for c in entry["cores"]}
|
||||
platform = {str(c) for c in config["cores"]}
|
||||
listed = {str(c) for s in config["systems"].values() for c in s.get("cores", [])}
|
||||
self.assertTrue(listed, "no system carries its cores")
|
||||
self.assertEqual(listed - platform, set())
|
||||
self.assertEqual(listed - platform - (listed - built), set())
|
||||
self.assertEqual(platform - built - {"lexaloffle", "mpv", "vox_official"}, set())
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@@ -207,6 +207,8 @@ class APlatformEntryTakesNoOtherEmulatorsTree(unittest.TestCase):
|
||||
|
||||
config = load_platform_config("emuelec", str(REPO_ROOT / "platforms"))
|
||||
entry = config["systems"]["vvvvvv"]["files"][0]
|
||||
# No image builds the VVVVVV port engine, but es_systems.json still
|
||||
# names it for the system: its tree is the one the entry asks for.
|
||||
self.assertEqual(entry["platform_cores"], ["VVVVVV"])
|
||||
db = load_database(str(REPO_ROOT / "database.json"))
|
||||
path, _status = resolve_local_file(
|
||||
|
||||
@@ -11269,8 +11269,10 @@ class TapsGameDataAndExitCodes(_CardFixtures, unittest.TestCase):
|
||||
lines = [str(line).strip() for line in install.tui_view(state, 120, 40)]
|
||||
folder = next(i for i, line in enumerate(lines) if line.startswith("BIOS folder:"))
|
||||
named = next(i for i, line in enumerate(lines) if line.startswith("Named by"))
|
||||
# Nothing between the folder, wrapped or not, and what named it.
|
||||
self.assertEqual("".join(lines[folder:named]), f"BIOS folder: {state.dest}", lines)
|
||||
# Nothing between the folder, wrapped or not, and what named it. A
|
||||
# long path wraps after the label, a longer one inside the path.
|
||||
self.assertEqual("".join(lines[folder:named]).replace(" ", ""),
|
||||
f"BIOS folder: {state.dest}".replace(" ", ""), lines)
|
||||
self.assertLess(named, next(i for i, line in enumerate(lines)
|
||||
if line.startswith(("For ", "Copy them"))))
|
||||
|
||||
@@ -12374,10 +12376,10 @@ class TapsOnAPtySeeFirst(unittest.TestCase):
|
||||
break
|
||||
term.send("\x1b[A")
|
||||
term.send("\r")
|
||||
# The changed choices are counted again on Confirm. Waiting on the
|
||||
# bare title matched the screen before it, and a runner that drew
|
||||
# Confirm after one settle never pressed Enter there.
|
||||
term.wait("RetroBIOS: Confirm")
|
||||
# The changed choices are counted again on Confirm, which has no
|
||||
# Install row until its dry run ends: Enter sent on the title alone
|
||||
# fell on "Counting the files" and did nothing on a slow runner.
|
||||
term.wait("Counted again for these choices")
|
||||
term.settle()
|
||||
term.send("\r")
|
||||
term.wait("files installed")
|
||||
|
||||
@@ -231,15 +231,20 @@ class APortableUserFolder(unittest.TestCase):
|
||||
|
||||
|
||||
|
||||
class ADefaultTheBuildLacksIsNotRun(unittest.TestCase):
|
||||
"""KNULLI's configgen-defaults.yml picks suyu for the Switch, which its
|
||||
es_systems.yml does not offer and no package builds."""
|
||||
class OnlyWhatABoardBuildsIsRun(unittest.TestCase):
|
||||
"""KNULLI's es_systems.yml lists citron and shadps4, which its Config.in
|
||||
selects only on x86_64 boards (it has none), and its
|
||||
configgen-defaults.yml picks suyu, which no package builds."""
|
||||
|
||||
ES = textwrap.dedent("""\
|
||||
switch:
|
||||
emulators:
|
||||
citron:
|
||||
citron: { requireAnyOf: [BR2_PACKAGE_CITRON] }
|
||||
gba:
|
||||
emulators:
|
||||
libretro:
|
||||
mgba: { requireAnyOf: [BR2_PACKAGE_LIBRETRO_MGBA] }
|
||||
voxatron:
|
||||
emulators: {}
|
||||
""")
|
||||
@@ -253,31 +258,67 @@ class ADefaultTheBuildLacksIsNotRun(unittest.TestCase):
|
||||
kodi:
|
||||
emulator: kodi
|
||||
core: kodi
|
||||
mpv:
|
||||
emulator: mpv
|
||||
core: mpv
|
||||
""")
|
||||
LAUNCHERS = [{"emulator": "lexaloffle", "kind": "fixed_name", "passes_to": "exec",
|
||||
"search_dir": "/userdata/bios"}]
|
||||
|
||||
def test_only_what_a_package_or_the_user_supplies_is_run(self):
|
||||
def selection(self, symbols: set[str]):
|
||||
from scraper.targets.batocera_targets_scraper import BuildSelection
|
||||
|
||||
return BuildSelection(
|
||||
targets={}, emulators=frozenset({"mgba"}),
|
||||
listed=frozenset({"citron", "mgba"}), symbols=frozenset(symbols),
|
||||
packages={"kodi": "BR2_PACKAGE_KODI"},
|
||||
)
|
||||
|
||||
def test_only_what_a_board_builds_or_the_user_supplies_is_run(self):
|
||||
from scraper import batocera_scraper as bs
|
||||
|
||||
paths = ["package/batocera/emulators/citron/Config.in", "package/kodi/Config.in"]
|
||||
built = bs.packages_and_programs(bs.package_names(paths), self.LAUNCHERS)
|
||||
# A board selects kodi's package and buildroot's mpv; citron is
|
||||
# listed by es_systems, so the symbol of a folder of that name does
|
||||
# not count for it.
|
||||
built = bs.boards_build(
|
||||
self.selection({"BR2_PACKAGE_KODI", "BR2_PACKAGE_MPV", "BR2_PACKAGE_CITRON_X"}),
|
||||
self.LAUNCHERS,
|
||||
)
|
||||
cores, standalone, _dual = bs.configgen_cores(self.DEFAULTS, self.ES, set(), built)
|
||||
self.assertEqual(sorted(cores), ["citron", "kodi", "vox_official"])
|
||||
self.assertIn("lexaloffle", standalone)
|
||||
self.assertNotIn("suyu", standalone)
|
||||
self.assertEqual(sorted(cores), ["kodi", "mgba", "mpv", "vox_official"])
|
||||
self.assertEqual(sorted(standalone), ["kodi", "lexaloffle", "mpv", "vox_official"])
|
||||
# Each system keeps the list es_systems.yml writes (whose files its
|
||||
# entries ask for), less a default no package builds.
|
||||
by_system = bs.es_systems_by_system(self.ES, self.DEFAULTS, set(), built)
|
||||
self.assertEqual(by_system["switch"], ["citron"])
|
||||
# Without the packages, every default counts, as before.
|
||||
self.assertEqual(by_system["voxatron"], ["lexaloffle", "vox_official"])
|
||||
self.assertEqual(by_system["gba"], ["mgba"])
|
||||
|
||||
def test_a_listed_name_is_built_only_through_its_packages(self):
|
||||
from scraper import batocera_scraper as bs
|
||||
|
||||
built = bs.boards_build(self.selection({"BR2_PACKAGE_CITRON"}), [])
|
||||
self.assertFalse(built("citron"))
|
||||
self.assertTrue(built("mgba"))
|
||||
self.assertFalse(built("lexaloffle"))
|
||||
# Without a selection, every name counts, as before.
|
||||
self.assertIn("suyu", bs.configgen_cores(self.DEFAULTS, self.ES, set())[0])
|
||||
|
||||
def test_the_real_knulli_list_names_no_suyu(self):
|
||||
def test_the_real_lists_name_only_what_a_board_builds(self):
|
||||
import yaml
|
||||
|
||||
config = yaml.safe_load((REPO_ROOT / "platforms" / "knulli.yml").read_text())
|
||||
self.assertNotIn("suyu", config["cores"])
|
||||
self.assertNotIn("suyu", config.get("standalone_cores") or [])
|
||||
|
||||
for platform, absent in (("knulli", ("suyu", "citron", "shadps4", "pcsx2")),
|
||||
("batocera", ("citron", "ryujinx", "applewin"))):
|
||||
config = yaml.safe_load((REPO_ROOT / "platforms" / f"{platform}.yml").read_text())
|
||||
names = set(config["cores"]) | set(config.get("standalone_cores") or [])
|
||||
targets = yaml.safe_load(
|
||||
(REPO_ROOT / "platforms" / "targets" / f"{platform}.yml").read_text())["targets"]
|
||||
boards = {c for entry in targets.values() for c in entry["cores"]}
|
||||
with self.subTest(platform=platform):
|
||||
self.assertFalse(names & set(absent))
|
||||
# What a board builds and the list once named is still there,
|
||||
# and what no board builds is a program the user supplies.
|
||||
self.assertLessEqual(names - boards, {"kodi", "lexaloffle", "mpv", "vox_official"})
|
||||
|
||||
|
||||
class AUserFolderInTheConfigsFolder(unittest.TestCase):
|
||||
@@ -289,7 +330,8 @@ class AUserFolderInTheConfigsFolder(unittest.TestCase):
|
||||
from common import standalone_set
|
||||
|
||||
profile = load_emulator_profiles(str(REPO_ROOT / "emulators"))["shadps4"]
|
||||
for platform in ("batocera", "knulli"):
|
||||
# KNULLI's generator does the same, but no KNULLI board builds shadps4.
|
||||
for platform in ("batocera",):
|
||||
config = load_platform_config(platform, str(REPO_ROOT / "platforms"))
|
||||
((view, _standalone),) = platform_layouts("shadps4", profile, standalone_set(config))
|
||||
with self.subTest(platform=platform):
|
||||
|
||||
@@ -639,8 +639,10 @@ class PlatformRecords(unittest.TestCase):
|
||||
cls.config = yaml.safe_load((REPO_ROOT / "platforms" / "rocknix.yml").read_text())
|
||||
|
||||
def test_every_emulator_is_one_rocknix_packages(self):
|
||||
# RetroArch itself runs the libretro cores the list names.
|
||||
cores = set(self.config["cores"])
|
||||
self.assertEqual(sorted({r["emulator"] for r in self.config["launchers"]} - cores), [])
|
||||
self.assertEqual(sorted({r["emulator"] for r in self.config["launchers"]} - cores),
|
||||
["retroarch"])
|
||||
|
||||
def test_every_reference_is_in_the_rocknix_project(self):
|
||||
for record in self.config["launchers"]:
|
||||
|
||||
@@ -480,7 +480,10 @@ class RocknixRunsItsStandaloneEmulators(unittest.TestCase):
|
||||
root = Path(__file__).resolve().parents[1]
|
||||
platform = yaml.safe_load((root / "platforms" / "rocknix.yml").read_text())
|
||||
self.assertIn(f"/distribution/{platform['version']}/", platform["source"])
|
||||
self.assertIn("retroarch", platform["cores"])
|
||||
# RetroArch runs the libretro cores some device image installs, not
|
||||
# every libretro profile.
|
||||
self.assertNotIn("retroarch", platform["cores"])
|
||||
self.assertIn("beetle_psx", platform["cores"])
|
||||
registry = yaml.safe_load((root / "platforms" / "_registry.yml").read_text())
|
||||
self.assertNotIn("cores", registry["platforms"]["rocknix"])
|
||||
|
||||
|
||||
@@ -548,12 +548,12 @@ class OpenmsxOnEachPlatform(unittest.TestCase):
|
||||
"""openMSX finds system ROMs by SHA1 in share/systemroms below its user
|
||||
directory and in every filepool entry. RetroBat sets OPENMSX_HOME to
|
||||
bios/openmsx, RetroPie links share/systemroms of its user directory to
|
||||
BIOS/openmsx, Batocera and KNULLI add bios/Machines and bios/openmsx to
|
||||
the filepool and list their own files in bios/openmsx."""
|
||||
BIOS/openmsx, Batocera adds bios/Machines and bios/openmsx to the
|
||||
filepool and lists its own files in bios/openmsx. KNULLI's generator
|
||||
does the same, but no KNULLI board builds openmsx."""
|
||||
|
||||
EXPECTED = {
|
||||
"batocera": {"share/systemroms": ("", "openmsx")},
|
||||
"knulli": {"share/systemroms": ("", "openmsx")},
|
||||
"retrobat": {"": ("", "openmsx")},
|
||||
"retropie": {"share/systemroms": ("", "openmsx")},
|
||||
}
|
||||
|
||||
+142
-24
@@ -97,6 +97,13 @@ class FailedRequestsStopTheScrape(unittest.TestCase):
|
||||
_refuse()
|
||||
return _Body(b"BR2_PACKAGE_BATOCERA_TARGET_X86_64=y\n"
|
||||
b"BR2_PACKAGE_BATOCERA_SYSTEM=y\n")
|
||||
if "/git/trees/" in url:
|
||||
return _Body(b'{"tree": [], "truncated": false}')
|
||||
if url.endswith("retroarch.mk"):
|
||||
return _Body(b"RETROARCH_CONF_OPTS = --enable-networking\n")
|
||||
if url.startswith("https://raw.githubusercontent.com/") and url.count("/") == 6:
|
||||
return _Body(b'source "$BR2_EXTERNAL_BATOCERA_PATH/'
|
||||
b'package/batocera/core/batocera-system/Config.in"\n')
|
||||
if url.endswith("Config.in"):
|
||||
return _Body(b"config BR2_PACKAGE_BATOCERA_SYSTEM\n"
|
||||
b"\tselect BR2_PACKAGE_MGBA\n\n"
|
||||
@@ -240,6 +247,61 @@ class BatoceraDerivedFlags(unittest.TestCase):
|
||||
self.assertIn("BR2_PACKAGE_DUCKSTATION_LEGACY", r16)
|
||||
|
||||
|
||||
class CoreDownloaderReach(unittest.TestCase):
|
||||
"""Batocera and KNULLI build RetroArch with its core downloader, shown in
|
||||
the menu, and its compiled buildbot URL serves Linux x86_64, i386 and
|
||||
armv7 hard-float alone (config.def.h:743-749, 1855-1864): a board of
|
||||
those runs any core of the buildbot list, an aarch64 one none."""
|
||||
|
||||
def test_each_architecture_reads_its_buildbot_list(self):
|
||||
from scraper.targets.batocera_targets_scraper import buildbot_target # noqa: PLC0415
|
||||
|
||||
self.assertEqual(buildbot_target({"BR2_x86_64"}), "linux-x86_64")
|
||||
self.assertEqual(buildbot_target({"BR2_arm", "BR2_ARM_CPU_ARMV7A"}), "linux-armhf")
|
||||
self.assertIsNone(buildbot_target({"BR2_arm", "BR2_ARM_CPU_ARMV7A", "BR2_ARM_EABI"}))
|
||||
self.assertIsNone(buildbot_target({"BR2_arm", "BR2_arm1176jzf_s"}))
|
||||
self.assertIsNone(buildbot_target({"BR2_aarch64"}))
|
||||
|
||||
def test_a_build_or_a_blank_url_turns_it_off(self):
|
||||
from scraper.targets.batocera_targets_scraper import downloader_disabled # noqa: PLC0415
|
||||
|
||||
self.assertIsNone(downloader_disabled("--enable-networking", {
|
||||
"a/retroarch.cfg": 'menu_show_core_updater = "false"\n'}))
|
||||
self.assertIn("HAVE_LAKKA=1", downloader_disabled("make HAVE_LAKKA=1", {}))
|
||||
with self.assertRaises(RuntimeError):
|
||||
downloader_disabled("", {"a/retroarch.cfg": 'core_updater_buildbot_cores_url = ""\n'})
|
||||
|
||||
def test_a_board_that_downloads_gets_the_buildbot_list(self):
|
||||
from common import load_target_config # noqa: PLC0415
|
||||
|
||||
root = str(REPO_ROOT / "platforms")
|
||||
x86 = set(load_target_config("retroarch", "linux-x86_64", root) or ())
|
||||
armhf = set(load_target_config("retroarch", "linux-armhf", root) or ())
|
||||
self.assertLessEqual(x86, set(load_target_config("batocera", "x86_64", root) or ()))
|
||||
self.assertLessEqual(armhf, set(load_target_config("batocera", "rk3288", root) or ()))
|
||||
self.assertFalse(x86 <= set(load_target_config("batocera", "bcm2711", root) or ()))
|
||||
self.assertLessEqual(armhf, set(load_target_config("knulli", "r16", root) or ()))
|
||||
|
||||
def test_the_platform_names_what_its_boards_install(self):
|
||||
import yaml # noqa: PLC0415
|
||||
|
||||
from common import load_target_config # noqa: PLC0415
|
||||
|
||||
root = str(REPO_ROOT / "platforms")
|
||||
for platform in ("batocera", "knulli"):
|
||||
config = yaml.safe_load((REPO_ROOT / "platforms" / f"{platform}.yml").read_text())
|
||||
targets = yaml.safe_load(
|
||||
(REPO_ROOT / "platforms" / "targets" / f"{platform}.yml").read_text())["targets"]
|
||||
fetched = set()
|
||||
for entry in targets.values():
|
||||
if entry.get("downloads"):
|
||||
fetched |= load_target_config("retroarch", entry["downloads"], root) or set()
|
||||
if entry["architecture"] == "aarch64":
|
||||
self.assertNotIn("downloads", entry)
|
||||
with self.subTest(platform=platform):
|
||||
self.assertEqual(set(config["installable_cores"]), fetched - set(config["cores"]))
|
||||
|
||||
|
||||
class KnulliPerBoard(unittest.TestCase):
|
||||
"""KNULLI builds per board on Batocera's model from its own tree:
|
||||
configs/knulli-*.board, package/system/knulli-system/Config.in and
|
||||
@@ -254,7 +316,7 @@ class KnulliPerBoard(unittest.TestCase):
|
||||
"BR2_PACKAGE_BATOCERA_TARGET_H700=y\n"
|
||||
),
|
||||
"configs/knulli-r16.board": (
|
||||
"include knulli-board.common\n\nBR2_arm=y\n"
|
||||
"include knulli-board.common\n\nBR2_arm=y\nBR2_cortex_a7=y\n"
|
||||
"BR2_PACKAGE_BATOCERA_TARGET_SUNXI_R16=y\n"
|
||||
),
|
||||
"configs/knulli-h700_armhf_libs.board": (
|
||||
@@ -262,6 +324,15 @@ class KnulliPerBoard(unittest.TestCase):
|
||||
"BR2_arm=y\nBR2_PACKAGE_BATOCERA_TARGET_H700=y\n"
|
||||
),
|
||||
"configs/knulli-h700_armhf_libs.packages": "BR2_PACKAGE_SDL2=y\n",
|
||||
# The root Config.in sources KNULLI's system and Batocera's packages
|
||||
# from the batocera submodule, where a package selects another.
|
||||
"Config.in": (
|
||||
'source "$BR2_EXTERNAL_KNULLI_PATH/package/system/knulli-system/Config.in"\n'
|
||||
'source "$BR2_EXTERNAL_KNULLI_PATH/batocera/package/batocera/emulators/'
|
||||
'ppsspp/Config.in"\n'
|
||||
'#source "$BR2_EXTERNAL_KNULLI_PATH/package/utils/off/Config.in"\n'
|
||||
'source "$BR2_EXTERNAL_KNULLI_PATH/package/utils/vtree/Config.in"\n'
|
||||
),
|
||||
"package/system/knulli-system/Config.in": (
|
||||
"if BR2_PACKAGE_BATOCERA_TARGET_H700 || \\\n"
|
||||
" BR2_PACKAGE_BATOCERA_TARGET_A133\n"
|
||||
@@ -282,6 +353,8 @@ class KnulliPerBoard(unittest.TestCase):
|
||||
" mgba: {requireAnyOf: [BR2_PACKAGE_LIBRETRO_MGBA]}\n"
|
||||
"psp:\n emulators:\n ppsspp:\n"
|
||||
" ppsspp: {requireAnyOf: [BR2_PACKAGE_PPSSPP]}\n"
|
||||
"pspassets:\n emulators:\n libretro:\n"
|
||||
" assets: {requireAnyOf: [BR2_PACKAGE_PPSSPP_ASSETS]}\n"
|
||||
),
|
||||
}
|
||||
|
||||
@@ -314,6 +387,23 @@ class KnulliPerBoard(unittest.TestCase):
|
||||
return _Body(json.dumps([{"name": n} for n in names]))
|
||||
if url == f"{api}buildroot?ref={pin}":
|
||||
return _Body('{"sha": "c2d7985b"}')
|
||||
if url == f"{api}batocera?ref={pin}":
|
||||
return _Body('{"sha": "487014d9"}')
|
||||
if "/git/trees/" in url:
|
||||
# A board config that hides the downloader leaves its URL.
|
||||
cfg = "board/r16/retroarch.cfg" if "knulli-linux" in url else "x"
|
||||
return _Body(json.dumps({"tree": [{"path": cfg}], "truncated": False}))
|
||||
if url == f"{raw}board/r16/retroarch.cfg":
|
||||
return _Body('menu_show_core_updater = "false"\n')
|
||||
if url == f"{raw}package/retroarch/retroarch/retroarch.mk":
|
||||
return _Body("RETROARCH_CONF_OPTS = --enable-networking\n")
|
||||
if url == ("https://raw.githubusercontent.com/batocera-linux/batocera.linux/"
|
||||
"487014d9/package/batocera/emulators/ppsspp/Config.in"):
|
||||
return _Body("config BR2_PACKAGE_PPSSPP\n\tselect BR2_PACKAGE_PPSSPP_ASSETS\n")
|
||||
if url == f"{raw}package/utils/vtree/Config.in":
|
||||
raise urllib.error.HTTPError(url, 404, "Not Found", {}, None)
|
||||
if url.endswith("/c2d7985b/arch/Config.in.arm"):
|
||||
return _Body("config BR2_cortex_a7\n\tselect BR2_ARM_CPU_ARMV7A\n")
|
||||
if url.startswith("https://raw.githubusercontent.com/knulli-cfw/buildroot/c2d7985b/"):
|
||||
return _Body("config BR2_aarch64\n\tselect BR2_ARCH_IS_64\n")
|
||||
path = url.removeprefix(raw)
|
||||
@@ -330,11 +420,14 @@ class KnulliPerBoard(unittest.TestCase):
|
||||
self.assertEqual(sorted(data["targets"]), ["h700", "r16"])
|
||||
# The images name what a card's boot/knulli.board holds.
|
||||
self.assertEqual(data["targets"]["h700"],
|
||||
{"architecture": "aarch64", "cores": ["mgba", "ppsspp"],
|
||||
{"architecture": "aarch64", "cores": ["assets", "mgba", "ppsspp"],
|
||||
"images": ["rg35xx-plus", "rg35xx-sp"]})
|
||||
# An armv7 hard-float board's RetroArch installs the armhf buildbot list.
|
||||
self.assertEqual(data["targets"]["r16"],
|
||||
{"architecture": "arm", "cores": ["mgba"], "images": ["miyoo-a30"]})
|
||||
self.assertTrue(all(pin in url or "buildroot/c2d7985b" in url for url in seen), seen)
|
||||
{"architecture": "arm", "cores": ["mgba"], "images": ["miyoo-a30"],
|
||||
"downloads": "linux-armhf"})
|
||||
self.assertTrue(all(pin in url or "buildroot/c2d7985b" in url
|
||||
or "487014d9" in url for url in seen), seen)
|
||||
|
||||
|
||||
class RocknixPerDevice(unittest.TestCase):
|
||||
@@ -371,35 +464,60 @@ class RocknixPerDevice(unittest.TestCase):
|
||||
)
|
||||
|
||||
def test_each_device_gets_its_own_cores(self):
|
||||
from scraper.targets.rocknix_targets_scraper import ( # noqa: PLC0415
|
||||
core_names,
|
||||
parse_device_cores,
|
||||
)
|
||||
from scraper.targets.rocknix_targets_scraper import parse_device_cores # noqa: PLC0415
|
||||
|
||||
h700 = core_names(*parse_device_cores(self.PACKAGE_MK, "H700", "aarch64", True))
|
||||
self.assertTrue({"drastic", "gpsp", "duckstation", "beetle_psx", "hatari",
|
||||
"81", "neocd"} <= set(h700))
|
||||
self.assertFalse({"aethersx2", "dolphin"} & set(h700))
|
||||
no32 = core_names(*parse_device_cores(self.PACKAGE_MK, "H700", "aarch64", False))
|
||||
self.assertNotIn("gpsp", no32)
|
||||
amd64 = core_names(*parse_device_cores(self.PACKAGE_MK, "AMD64", "x86_64", False))
|
||||
self.assertIn("dolphin", amd64)
|
||||
self.assertNotIn("drastic", amd64)
|
||||
libretro, standalone = parse_device_cores(self.PACKAGE_MK, "H700", "aarch64", True)
|
||||
self.assertTrue({"gpsp-lr", "duckstation-lr", "beetle-psx-lr", "81-lr",
|
||||
"neocd_lr"} <= set(libretro))
|
||||
self.assertTrue({"drastic-sa", "hatarisa"} <= set(standalone))
|
||||
self.assertFalse({"aethersx2-sa", "dolphin-sa"} & set(standalone))
|
||||
libretro, _ = parse_device_cores(self.PACKAGE_MK, "H700", "aarch64", False)
|
||||
self.assertNotIn("gpsp-lr", libretro)
|
||||
_, standalone = parse_device_cores(self.PACKAGE_MK, "AMD64", "x86_64", False)
|
||||
self.assertIn("dolphin-sa", standalone)
|
||||
self.assertNotIn("drastic-sa", standalone)
|
||||
|
||||
def test_a_package_names_the_cores_it_installs(self):
|
||||
"""vice-lr builds ten EMUTYPEs: read as the package name, vice_x64
|
||||
and its siblings reached no ROCKNIX device."""
|
||||
from scraper.targets.rocknix_targets_scraper import installed_cores # noqa: PLC0415
|
||||
|
||||
vice = ("makeinstall_target() {\n mkdir -p ${INSTALL}/usr/lib/libretro\n"
|
||||
" cp -a built/vice_x128_libretro.so ${INSTALL}/usr/lib/libretro\n"
|
||||
" cp -a built/vice_x64_libretro.so ${INSTALL}/usr/lib/libretro\n}\n")
|
||||
self.assertEqual(installed_cores(vice, "aarch64", True), ["vice_x128", "vice_x64"])
|
||||
renamed = ("makeinstall_target() {\n"
|
||||
" cp -a mednafen_psx_libretro.so ${INSTALL}/usr/lib/libretro/beetle_psx_libretro.so\n"
|
||||
" cp -a fake08_libretro.{so,info} $INSTALL/usr/lib/libretro\n}\n")
|
||||
self.assertEqual(installed_cores(renamed, "aarch64", True), ["beetle_psx", "fake08"])
|
||||
pcsx = ("makeinstall_target() {\n"
|
||||
" case ${TARGET_ARCH} in\n"
|
||||
" aarch64|x86_64) cp -a ../pcsx_rearmed_libretro.so ${INSTALL}/usr/lib/libretro ;;\n"
|
||||
" arm) cp -a ../pcsx_rearmed_libretro.so ${INSTALL}/usr/lib/libretro/pcsx_rearmed32_libretro.so ;;\n"
|
||||
" esac\n"
|
||||
' if [ "${TARGET_ARCH}" = "aarch64" ] && [ "${ENABLE_32BIT}" = "true" ]; then\n'
|
||||
" cp -a x/usr/lib/libretro/pcsx_rearmed32_libretro.so ${INSTALL}/usr/lib/libretro\n"
|
||||
" fi\n}\n")
|
||||
self.assertEqual(installed_cores(pcsx, "aarch64", True), ["pcsx_rearmed", "pcsx_rearmed32"])
|
||||
self.assertEqual(installed_cores(pcsx, "aarch64", False), ["pcsx_rearmed"])
|
||||
self.assertEqual(installed_cores(pcsx, "x86_64", True), ["pcsx_rearmed"])
|
||||
with self.assertRaises(RuntimeError):
|
||||
installed_cores('makeinstall_target() {\n if [ "${DEVICE}" = "H700" ]; then\n'
|
||||
" cp a_libretro.so ${INSTALL}/usr/lib/libretro\n fi\n}\n",
|
||||
"aarch64", True)
|
||||
with self.assertRaises(RuntimeError):
|
||||
installed_cores("makeinstall_target() {\n :\n}\n", "aarch64", True)
|
||||
|
||||
def test_a_standalone_package_keeps_both_spellings(self):
|
||||
"""vice-standalone answers to vice-sa only, as scummvm-standalone to
|
||||
scummvm-sa: stripped to vice, every targeted pack left them out
|
||||
while the untargeted one, read from the platform scraper, kept them."""
|
||||
from scraper.rocknix_scraper import standalone_emulators # noqa: PLC0415
|
||||
from scraper.targets.rocknix_targets_scraper import ( # noqa: PLC0415
|
||||
core_names,
|
||||
parse_device_cores,
|
||||
)
|
||||
from scraper.targets.rocknix_targets_scraper import parse_device_cores # noqa: PLC0415
|
||||
|
||||
libretro, standalone = parse_device_cores(self.PACKAGE_MK, "SM8550", "aarch64", False)
|
||||
names = set(core_names(libretro, standalone))
|
||||
_, standalone = parse_device_cores(self.PACKAGE_MK, "SM8550", "aarch64", False)
|
||||
names = set(standalone_emulators(standalone))
|
||||
self.assertTrue({"aethersx2-sa", "aethersx2", "dolphin-sa", "dolphin"} <= names)
|
||||
self.assertTrue(set(standalone_emulators(standalone)) <= names)
|
||||
|
||||
def test_a_metapackage_names_the_cores_it_installs(self):
|
||||
from scraper.targets.rocknix_targets_scraper import metapackage_cores # noqa: PLC0415
|
||||
|
||||
Reference in new issue
Block a user