mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-03 16:43:54 -06:00
chore: merge true platform list versions
# Conflicts: # install.ps1 # install.py # install.sh # install/launchers/index.json
This commit is contained in:
commit
7ec4d00375
45 files changed
+559
-64
No files matched your search
@@ -2080,6 +2080,59 @@ def _git_paths(*args: str, stdin: list[str] | None = None) -> set[str] | None:
|
||||
return {p for p in result.stdout.split("\0") if p}
|
||||
|
||||
|
||||
class ManifestVersionIsThePlatformsOwn(unittest.TestCase):
|
||||
"""Every install manifest named its list "1.0", and an inheriting YAML
|
||||
took its parent's version: Lakka was published as RetroArch v1.22.2.
|
||||
The installer compares the list's version with the one a machine runs,
|
||||
so each manifest states the version its own platform YAML records."""
|
||||
|
||||
def setUp(self):
|
||||
from scripts.common import _platform_config_cache
|
||||
_platform_config_cache.clear()
|
||||
|
||||
def test_committed_manifests_state_their_platform_version(self):
|
||||
from scripts.common import load_platform_config
|
||||
manifests = sorted((ROOT / "install").glob("*.json"))
|
||||
self.assertTrue(manifests)
|
||||
for path in manifests:
|
||||
with self.subTest(manifest=path.name):
|
||||
data = json.loads(path.read_text())
|
||||
config = load_platform_config(data["platform"], str(ROOT / "platforms"))
|
||||
self.assertTrue(config.get("version"))
|
||||
self.assertEqual(data["version"], str(config["version"]))
|
||||
|
||||
def test_no_child_shows_its_parents_version(self):
|
||||
from scripts.common import load_platform_config
|
||||
platforms = ROOT / "platforms"
|
||||
children = {}
|
||||
for path in sorted(platforms.glob("*.yml")):
|
||||
raw = yaml.safe_load(path.read_text()) or {}
|
||||
if isinstance(raw, dict) and raw.get("inherits"):
|
||||
children[path.stem] = raw
|
||||
self.assertIn("lakka", children)
|
||||
for name, raw in children.items():
|
||||
with self.subTest(platform=name):
|
||||
parent = yaml.safe_load(
|
||||
(platforms / f"{raw['inherits']}.yml").read_text())
|
||||
version = load_platform_config(name, str(platforms)).get("version")
|
||||
self.assertEqual(version, raw.get("version"))
|
||||
self.assertNotEqual(version, parent.get("version"))
|
||||
|
||||
def test_an_unversioned_child_has_no_version(self):
|
||||
from scripts.common import load_platform_config
|
||||
with tempfile.TemporaryDirectory(dir=TMP_ROOT) as tmp:
|
||||
Path(tmp, "parent.yml").write_text("platform: P\nversion: '2.0'\nsystems: {}\n")
|
||||
Path(tmp, "child.yml").write_text("inherits: parent\nplatform: C\n")
|
||||
self.assertNotIn("version", load_platform_config("child", tmp))
|
||||
|
||||
def test_lakka_names_the_release_its_cores_are_read_at(self):
|
||||
platforms = ROOT / "platforms"
|
||||
lakka = yaml.safe_load((platforms / "lakka.yml").read_text())
|
||||
targets = yaml.safe_load((platforms / "targets" / "lakka.yml").read_text())
|
||||
tag = re.search(r"/blob/([^/]+)/", targets["source"]).group(1)
|
||||
self.assertEqual(lakka["version"], tag)
|
||||
|
||||
|
||||
class EveryManifestEntryIsFetchable(unittest.TestCase):
|
||||
"""An install manifest may not list a file the installer cannot get.
|
||||
|
||||
|
||||
@@ -58,6 +58,7 @@ class ACoreFileFillsAFreeDeclaration(unittest.TestCase):
|
||||
self.emulators.mkdir()
|
||||
(self.platforms / "fakeplat.yml").write_text(yaml.safe_dump({
|
||||
"platform": "FakePlat",
|
||||
"version": "2.1",
|
||||
"verification_mode": "existence",
|
||||
"base_destination": "system",
|
||||
"cores": ["fakecore"],
|
||||
@@ -118,7 +119,7 @@ class AFileDeclaredUnderAnotherName(unittest.TestCase):
|
||||
(root / "platforms").mkdir()
|
||||
(root / "emulators").mkdir()
|
||||
(root / "platforms" / "fakeplat.yml").write_text(yaml.safe_dump({
|
||||
"platform": "FakePlat", "verification_mode": "existence",
|
||||
"platform": "FakePlat", "version": "2.1", "verification_mode": "existence",
|
||||
"base_destination": "system", "cores": ["gs"],
|
||||
"systems": {"apple-iigs": {"files": [
|
||||
{"name": "ROM1", "destination": "ROM1", "md5": md5},
|
||||
@@ -156,7 +157,7 @@ class AMissingDataDirectoryFailsTheRun(unittest.TestCase):
|
||||
(root / "emulators").mkdir()
|
||||
(root / "bios").mkdir()
|
||||
(root / "platforms" / "fakeplat.yml").write_text(yaml.safe_dump({
|
||||
"platform": "FakePlat", "verification_mode": "existence",
|
||||
"platform": "FakePlat", "version": "2.1", "verification_mode": "existence",
|
||||
"base_destination": "system", "cores": [],
|
||||
"systems": {"console-a": {"files": [], "data_directories": [
|
||||
{"ref": "assets", "destination": "assets"},
|
||||
@@ -197,7 +198,7 @@ class AFileNobodyHoldsIsAnOmission(unittest.TestCase):
|
||||
for folder in ("platforms", "emulators", "bios"):
|
||||
(root / folder).mkdir()
|
||||
(root / "platforms" / "fakeplat.yml").write_text(yaml.safe_dump({
|
||||
"platform": "FakePlat", "verification_mode": "existence",
|
||||
"platform": "FakePlat", "version": "2.1", "verification_mode": "existence",
|
||||
"base_destination": "system", "cores": ["devil"],
|
||||
"systems": {"diablo": {"files": []}},
|
||||
}))
|
||||
@@ -238,7 +239,7 @@ class AMemberNameIsNotALooseFile(unittest.TestCase):
|
||||
(root / "platforms").mkdir()
|
||||
(root / "emulators").mkdir()
|
||||
(root / "platforms" / "fakeplat.yml").write_text(yaml.safe_dump({
|
||||
"platform": "FakePlat", "verification_mode": "existence",
|
||||
"platform": "FakePlat", "version": "2.1", "verification_mode": "existence",
|
||||
"base_destination": "system", "cores": ["naomi2core"],
|
||||
"systems": {"sega-naomi2": {"files": []}},
|
||||
}))
|
||||
@@ -283,7 +284,7 @@ class TwoDeclarationsOfOnePath(unittest.TestCase):
|
||||
for folder in ("platforms", "emulators"):
|
||||
(root / folder).mkdir()
|
||||
(root / "platforms" / "fakeplat.yml").write_text(yaml.safe_dump({
|
||||
"platform": "FakePlat", "verification_mode": "existence",
|
||||
"platform": "FakePlat", "version": "2.1", "verification_mode": "existence",
|
||||
"base_destination": "system", "cores": [],
|
||||
"systems": {
|
||||
"a-system": {"files": [{"name": first, "destination": "shared.bin"}]},
|
||||
@@ -335,7 +336,7 @@ class ANamelessWhitelistEntry(unittest.TestCase):
|
||||
(root / folder).mkdir()
|
||||
values = [md5.upper(), f"{'0' * 32},{md5}", "f" * 32]
|
||||
(root / "platforms" / "fakeplat.yml").write_text(yaml.safe_dump({
|
||||
"platform": "FakePlat", "verification_mode": "md5",
|
||||
"platform": "FakePlat", "version": "2.1", "verification_mode": "md5",
|
||||
"base_destination": "bios", "cores": [],
|
||||
"systems": {"sony-playstation": {"files": [
|
||||
{"name": f"sony-playstation:{v}", "destination": "", "md5": v}
|
||||
|
||||
@@ -76,7 +76,7 @@ class _Collection(unittest.TestCase):
|
||||
}}
|
||||
self.db = {"files": files, "indexes": generate_db.build_indexes(files, {})}
|
||||
self.config = {
|
||||
"platform": "Exist", "verification_mode": "existence",
|
||||
"platform": "Exist", "version": "2.1", "verification_mode": "existence",
|
||||
"cores": ["sized", "unsized"],
|
||||
"systems": {"mac": {"files": []}, "iigs": {"files": []}},
|
||||
}
|
||||
|
||||
@@ -56,6 +56,7 @@ files:
|
||||
|
||||
PLATFORM = {
|
||||
"platform": "Demo",
|
||||
"version": "2.1",
|
||||
"verification_mode": "existence",
|
||||
"base_destination": "",
|
||||
"cores": ["demo"],
|
||||
|
||||
@@ -224,6 +224,7 @@ class TestE2E(unittest.TestCase):
|
||||
def _create_existence_platform(self):
|
||||
config = {
|
||||
"platform": "TestExistence",
|
||||
"version": "9.1",
|
||||
"verification_mode": "existence",
|
||||
"base_destination": "system",
|
||||
"systems": {
|
||||
@@ -3676,6 +3677,51 @@ class TestE2E(unittest.TestCase):
|
||||
self.assertIsInstance(f["size"], int)
|
||||
self.assertGreater(len(f["sha1"]), 0)
|
||||
|
||||
def test_91_manifest_version_is_the_platform_list_version(self):
|
||||
"""The manifest names the version of the list it was built from.
|
||||
|
||||
It was the constant "1.0" for every platform, so the installer could
|
||||
not tell which Batocera or Recalbox release a list described. Two
|
||||
platforms of different versions show the value comes from each YAML.
|
||||
A YAML without one, an inheriting child included, is refused rather
|
||||
than written with a stand-in or its parent's version.
|
||||
"""
|
||||
from common import _platform_config_cache
|
||||
from generate_pack import generate_manifest
|
||||
|
||||
registry_path = os.path.join(self.platforms_dir, "_test_registry_version.yml")
|
||||
with open(registry_path, "w") as fh:
|
||||
yaml.dump({"platforms": {}}, fh)
|
||||
with open(os.path.join(self.platforms_dir, "test_md5.yml")) as fh:
|
||||
config = yaml.safe_load(fh)
|
||||
config["version"] = "41"
|
||||
with open(os.path.join(self.platforms_dir, "versioned_md5.yml"), "w") as fh:
|
||||
yaml.dump(config, fh)
|
||||
del config["version"]
|
||||
with open(os.path.join(self.platforms_dir, "unversioned.yml"), "w") as fh:
|
||||
yaml.dump(config, fh)
|
||||
_platform_config_cache.clear()
|
||||
|
||||
def version_of(name: str) -> str:
|
||||
return generate_manifest(
|
||||
name, self.platforms_dir, self.db, self.bios_dir, registry_path,
|
||||
emulators_dir=self.emulators_dir, offline=True,
|
||||
)["version"]
|
||||
|
||||
self.assertEqual(version_of("test_existence"), "9.1")
|
||||
self.assertEqual(version_of("versioned_md5"), "41")
|
||||
for name in ("unversioned", "test_inherited"):
|
||||
with self.subTest(platform=name), \
|
||||
self.assertRaisesRegex(ValueError, "records no version"):
|
||||
version_of(name)
|
||||
with open(os.path.join(self.platforms_dir, "test_inherited.yml")) as fh:
|
||||
child = yaml.safe_load(fh)
|
||||
child["version"] = "2"
|
||||
with open(os.path.join(self.platforms_dir, "test_inherited.yml"), "w") as fh:
|
||||
yaml.dump(child, fh)
|
||||
_platform_config_cache.clear()
|
||||
self.assertEqual(version_of("test_inherited"), "2")
|
||||
|
||||
def test_91b_manifest_hash_points_at_a_fetchable_file(self):
|
||||
"""A declared hash no local file carries must not blank repo_path.
|
||||
|
||||
@@ -5726,6 +5772,7 @@ struct BurnDriver BurnDrvneogeo = {
|
||||
self.db = self._build_db()
|
||||
config = {
|
||||
"platform": "RegionPlat",
|
||||
"version": "3.0",
|
||||
"verification_mode": "existence",
|
||||
"systems": {
|
||||
"region-console": {
|
||||
|
||||
@@ -47,6 +47,7 @@ class FrontendDigestDecides(unittest.TestCase):
|
||||
)
|
||||
(self.platforms / "digestplat.yml").write_text(yaml.safe_dump({
|
||||
"platform": "DigestPlat",
|
||||
"version": "2.1",
|
||||
"verification_mode": "md5",
|
||||
"base_destination": "bios",
|
||||
"systems": {"psx": {"files": [{
|
||||
|
||||
@@ -23,6 +23,7 @@ import unittest
|
||||
from types import SimpleNamespace
|
||||
import unittest.mock
|
||||
import urllib.error
|
||||
import zipfile
|
||||
from pathlib import Path
|
||||
|
||||
REPO_ROOT = Path(__file__).resolve().parent.parent
|
||||
@@ -5852,5 +5853,157 @@ class KeptFilesEndToEnd(unittest.TestCase, _SyntheticTree):
|
||||
self.assertEqual(len(list((self.home / install.BACKUP_DIR).iterdir())), 2)
|
||||
|
||||
|
||||
|
||||
class TheListVersionIsComparedWithTheSystems(unittest.TestCase):
|
||||
"""The list says which version of the platform it was built for, and the
|
||||
installer reads the version the system runs from the file the system
|
||||
writes. A difference is said, never refused."""
|
||||
|
||||
def note(self, plat: str, listed: str, bios: Path = Path("/userdata/bios")):
|
||||
return install.version_note(plat, bios, {"platform": plat, "version": listed})
|
||||
|
||||
def test_batocera_reads_the_first_word_of_its_version_file(self):
|
||||
_device(self, {"/usr/share/batocera/batocera.version": "41 2025/01/17 10:12\n"})
|
||||
listed, installed, text = self.note("batocera", "43.1")
|
||||
self.assertEqual((listed, installed), ("43.1", "41"))
|
||||
self.assertEqual(
|
||||
text, "This list was built for Batocera 43.1, this machine runs 41. "
|
||||
"Batocera's own BIOS check may report some files as wrong though they work.")
|
||||
self.assertIsNone(self.note("batocera", "41"))
|
||||
|
||||
def test_recalbox_reads_only_a_release(self):
|
||||
_device(self, {"/recalbox/recalbox.version": "10.0\n"})
|
||||
self.assertEqual(self.note("recalbox", "10.1.1")[:2], ("10.1.1", "10.0"))
|
||||
self.assertIsNone(self.note("recalbox", "10.0"))
|
||||
for built in ("development", "2026/10/01 main (4242)"):
|
||||
with self.subTest(built=built):
|
||||
_device(self, {"/recalbox/recalbox.version": built})
|
||||
self.assertIsNone(self.note("recalbox", "10.1.1"))
|
||||
|
||||
def test_retrobat_reads_the_folder_beside_its_bios_folder(self):
|
||||
root = Path(_tempdir(self))
|
||||
version = root / "system" / "version.info"
|
||||
version.parent.mkdir()
|
||||
version.write_text("8.3.1.1-stable-win64")
|
||||
# The release tagged 8.3.1 ships 8.3.1.1.
|
||||
self.assertIsNone(self.note("retrobat", "8.3.1", root / "bios"))
|
||||
version.write_text("8.2.0-stable-win64")
|
||||
self.assertEqual(self.note("retrobat", "8.3.1", root / "bios")[:2],
|
||||
("8.3.1", "8.2.0"))
|
||||
|
||||
def test_lakka_and_emuelec_read_os_release(self):
|
||||
_device(self, {}, release='NAME="Lakka"\nID="lakka"\nVERSION_ID="6.0"\n')
|
||||
listed, installed, text = self.note("lakka", "v6.1")
|
||||
self.assertEqual((listed, installed), ("v6.1", "6.0"))
|
||||
self.assertIn("Lakka checks only that a file is there", text)
|
||||
_device(self, {}, release='NAME="Lakka"\nID="lakka"\nVERSION_ID="6.1"\n')
|
||||
self.assertIsNone(self.note("lakka", "v6.1"))
|
||||
_device(self, {}, release='NAME="EmuELEC"\nVERSION_ID="4.7"\n')
|
||||
self.assertEqual(self.note("emuelec", "4.8")[:2], ("4.8", "4.7"))
|
||||
# The file of another system says nothing about this one.
|
||||
self.assertIsNone(self.note("lakka", "v6.1"))
|
||||
|
||||
def test_an_unknown_version_says_nothing(self):
|
||||
_device(self, {"/usr/share/batocera/batocera.version": "41 2025/01/17 10:12"})
|
||||
self.assertIsNone(self.note("batocera", "1.0"))
|
||||
self.assertIsNone(install.version_note("batocera", Path("/userdata/bios"),
|
||||
{"platform": "batocera"}))
|
||||
self.assertIsNone(self.note("retroarch", "v1.22.2"))
|
||||
_device(self, {"/usr/share/knulli/knulli.version": "scarab 2026/05/11 10:00"})
|
||||
self.assertIsNone(self.note("knulli", "20260511"))
|
||||
_device(self, {})
|
||||
self.assertIsNone(self.note("batocera", "43.1"))
|
||||
_device(self, {"/usr/share/batocera/batocera.version": "\x1b[2J 2025/01/17"})
|
||||
self.assertIsNone(self.note("batocera", "43.1"))
|
||||
|
||||
def test_a_pack_alone_gives_the_version_of_its_list(self):
|
||||
"""A handheld without network installs from the pack: its manifest.json
|
||||
records the list's version, which generate_pack takes from the
|
||||
install list built with the same choices."""
|
||||
sys.path.insert(0, str(REPO_ROOT / "scripts"))
|
||||
import generate_pack
|
||||
data = b"bios"
|
||||
install_list = {"version": "43.1", "files": [
|
||||
{"dest": "a.bin", "sha1": hashlib.sha1(data).hexdigest(), "size": 4}]}
|
||||
pack_list = {"files": [{"path": "a.bin", "sha1": hashlib.sha1(data).hexdigest(),
|
||||
"size": 4}]}
|
||||
generate_pack.annotate_pack_systems(pack_list, generate_pack.pack_systems(install_list))
|
||||
self.assertEqual(pack_list["list_version"], "43.1")
|
||||
pack = Path(_tempdir(self)) / "Batocera_43.1_BIOS_Pack.zip"
|
||||
with zipfile.ZipFile(pack, "w") as archive:
|
||||
archive.writestr("manifest.json", json.dumps(pack_list))
|
||||
archive.writestr("a.bin", data)
|
||||
source = install.PackSource([pack])
|
||||
self.addCleanup(source.close)
|
||||
self.assertEqual(source.manifest("batocera")["version"], "43.1")
|
||||
|
||||
def test_the_result_repeats_it_in_every_ending(self):
|
||||
for kw in ({"downloaded": 3}, {"errors": 2}, {"downloaded": 1, "errors": 1}):
|
||||
with self.subTest(**kw):
|
||||
buf = io.StringIO()
|
||||
with contextlib.redirect_stdout(buf), contextlib.suppress(SystemExit):
|
||||
install._report_outcome([Path("/userdata/bios")], omitted=0,
|
||||
interrupted=False, notes=["Built for 43.1."],
|
||||
**{"downloaded": 0, "up_to_date": 0,
|
||||
"errors": 0, **kw})
|
||||
self.assertIn("Built for 43.1.", buf.getvalue())
|
||||
|
||||
|
||||
class TheListVersionIsSaidBeforeAndAfter(unittest.TestCase):
|
||||
"""A RetroBat folder holding 8.2.0 and a list built for 8.3.1, through
|
||||
the installer as a person and as the screen run it."""
|
||||
|
||||
DATA = b"retrobat bios" * 8
|
||||
|
||||
def setUp(self):
|
||||
self.root = Path(_tempdir(self))
|
||||
(self.root / "system").mkdir()
|
||||
(self.root / "system" / "version.info").write_text("8.2.0-stable-win64")
|
||||
self.bios = self.root / "bios"
|
||||
self.bios.mkdir()
|
||||
(self.bios / "a.bin").write_bytes(self.DATA)
|
||||
self.list = self.root / "retrobat.json"
|
||||
self.list.write_text(json.dumps({
|
||||
"manifest_version": 2, "platform": "retrobat", "version": "8.3.1",
|
||||
"files": [{"dest": "a.bin", "sha1": hashlib.sha1(self.DATA).hexdigest(),
|
||||
"size": len(self.DATA), "repo_path": "bios/a.bin"}],
|
||||
}))
|
||||
|
||||
def run_installer(self, *options: str) -> subprocess.CompletedProcess:
|
||||
return subprocess.run(
|
||||
[sys.executable, str(REPO_ROOT / "install.py"), "--platform", "retrobat",
|
||||
"--dest", str(self.bios), "--manifest", str(self.list), "--offline",
|
||||
"--yes", *options],
|
||||
capture_output=True, text=True, timeout=120, check=False,
|
||||
stdin=subprocess.DEVNULL,
|
||||
)
|
||||
|
||||
SAID = ("This list was built for RetroBat 8.3.1, this machine runs 8.2.0. "
|
||||
"RetroBat's own BIOS check may report some files as wrong though they work.")
|
||||
|
||||
def test_line_mode_says_it_before_the_install_and_with_the_result(self):
|
||||
proc = self.run_installer()
|
||||
self.assertEqual(proc.returncode, 0, proc.stdout + proc.stderr)
|
||||
self.assertEqual(proc.stdout.count(self.SAID), 2, proc.stdout)
|
||||
self.assertLess(proc.stdout.index(self.SAID), proc.stdout.index("Checking existing"))
|
||||
self.assertGreater(proc.stdout.rindex(self.SAID), proc.stdout.index("Done."))
|
||||
|
||||
def test_the_screen_reads_an_event(self):
|
||||
proc = self.run_installer("--check", "--events")
|
||||
events = [json.loads(line) for line in proc.stdout.splitlines()]
|
||||
said = [event for event in events if event["event"] == "version"]
|
||||
self.assertEqual(said, [{"event": "version", "platform": "retrobat",
|
||||
"list_version": "8.3.1", "installed_version": "8.2.0",
|
||||
"message": self.SAID}])
|
||||
kinds = [event["event"] for event in events]
|
||||
self.assertLess(kinds.index("version"), kinds.index("check"))
|
||||
|
||||
def test_the_same_version_says_nothing(self):
|
||||
(self.root / "system" / "version.info").write_text("8.3.1.1-stable-win64")
|
||||
proc = self.run_installer()
|
||||
self.assertEqual(proc.returncode, 0, proc.stdout + proc.stderr)
|
||||
self.assertNotIn("This list was built for", proc.stdout)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
@@ -1021,7 +1021,7 @@ class AHeldFileTheInstallerCannotFetch(unittest.TestCase):
|
||||
self.db = {"files": files, "indexes": generate_db.build_indexes(files, {})}
|
||||
Path("platforms").mkdir()
|
||||
Path("platforms/p.yml").write_text(json.dumps({
|
||||
"platform": "P", "verification_mode": "existence", "cores": ["core"],
|
||||
"platform": "P", "version": "2.1", "verification_mode": "existence", "cores": ["core"],
|
||||
"systems": {"sys": {"files": []}},
|
||||
}))
|
||||
Path("platforms/_registry.yml").write_text(
|
||||
@@ -1096,7 +1096,7 @@ class AStandaloneLayoutBelowTheBiosFolder(unittest.TestCase):
|
||||
self.db = {"files": files, "indexes": generate_db.build_indexes(files, {})}
|
||||
Path("platforms").mkdir()
|
||||
Path("platforms/p.yml").write_text(json.dumps({
|
||||
"platform": "P", "verification_mode": "existence",
|
||||
"platform": "P", "version": "2.1", "verification_mode": "existence",
|
||||
"base_destination": "bios", "cores": ["dsa", "other"],
|
||||
"standalone_cores": ["dsa"], "systems": {"sys": {"files": []}},
|
||||
}))
|
||||
|
||||
@@ -193,6 +193,7 @@ class PackPlacesCoreFilesUnderTheTag(unittest.TestCase):
|
||||
|
||||
platform = {
|
||||
"platform": "MinUI Test",
|
||||
"version": "2025-11-27",
|
||||
"base_destination": "",
|
||||
"verification_mode": "existence",
|
||||
"cores": ["gambatte", "arcadecore", "unlisted"],
|
||||
|
||||
@@ -92,7 +92,7 @@ class _Fixture(unittest.TestCase):
|
||||
for key, profile in PROFILES.items():
|
||||
(self.emulators / f"{key}.yml").write_text(yaml.dump(profile))
|
||||
platform = {
|
||||
"platform": "Handheld", "verification_mode": "existence",
|
||||
"platform": "Handheld", "version": "2.1", "verification_mode": "existence",
|
||||
"cores": ["emu", "doomcore"],
|
||||
"systems": {
|
||||
"console": {"files": [{"name": "firmware.rom", "destination": "firmware.rom"}]},
|
||||
|
||||
@@ -52,6 +52,7 @@ files:
|
||||
|
||||
PLATFORM = {
|
||||
"platform": "Demo",
|
||||
"version": "2.1",
|
||||
"verification_mode": "existence",
|
||||
"base_destination": "",
|
||||
"cores": ["demo"],
|
||||
@@ -494,7 +495,7 @@ class RefusedFilesAreNotPresent(unittest.TestCase):
|
||||
}
|
||||
db = {"files": files, "indexes": generate_db.build_indexes(files, {})}
|
||||
config = {
|
||||
"platform": "Hashy", "verification_mode": "md5", "base_destination": "bios",
|
||||
"platform": "Hashy", "version": "2.1", "verification_mode": "md5", "base_destination": "bios",
|
||||
"systems": {"sys": {"files": [
|
||||
{"name": "good.bin", "destination": "good.bin",
|
||||
"md5": hashlib.md5(b"good.bin").hexdigest()},
|
||||
|
||||
@@ -51,6 +51,7 @@ class RequiredTwins(unittest.TestCase):
|
||||
self.db = {"files": files, "indexes": generate_db.build_indexes(files, {})}
|
||||
platform = {
|
||||
"platform": "Twins",
|
||||
"version": "2.1",
|
||||
"verification_mode": "md5",
|
||||
"base_destination": "bios",
|
||||
"cores": [],
|
||||
|
||||
@@ -243,7 +243,7 @@ class _Fixture(unittest.TestCase):
|
||||
"required": False}]}
|
||||
for name in ("testra", "testnosave"):
|
||||
(self.platforms / f"{name}.yml").write_text(yaml.safe_dump({
|
||||
"platform": name, "verification_mode": "existence",
|
||||
"platform": name, "version": "2.1", "verification_mode": "existence",
|
||||
"base_destination": "system", "cores": ["corex"],
|
||||
"systems": {"test-console": system},
|
||||
}))
|
||||
@@ -399,7 +399,7 @@ class AFolderPerSystem(_Fixture):
|
||||
"required": False}]}
|
||||
for name in ("testbato", "testrb"):
|
||||
(self.platforms / f"{name}.yml").write_text(yaml.safe_dump({
|
||||
"platform": name, "verification_mode": "existence",
|
||||
"platform": name, "version": "2.1", "verification_mode": "existence",
|
||||
"base_destination": "bios", "cores": ["corex", "corey"],
|
||||
"systems": {"test-console": system},
|
||||
# Two systems run CoreX, none runs CoreY.
|
||||
|
||||
@@ -58,6 +58,7 @@ class SlugPlatform(unittest.TestCase):
|
||||
self.db = {"files": files, "indexes": generate_db.build_indexes(files, {})}
|
||||
self.config = {
|
||||
"platform": "Slugs",
|
||||
"version": "2.1",
|
||||
"verification_mode": "md5",
|
||||
"base_destination": "bios",
|
||||
"cores": ["dosbox"],
|
||||
@@ -139,7 +140,7 @@ class RegionKeysForEveryClaimant(unittest.TestCase):
|
||||
)
|
||||
common._emulator_profiles_cache.clear()
|
||||
profiles = common.load_emulator_profiles("emulators")
|
||||
config = {"platform": "P", "verification_mode": "existence", "cores": ["one", "two"],
|
||||
config = {"platform": "P", "version": "2.1", "verification_mode": "existence", "cores": ["one", "two"],
|
||||
"systems": {"sys": {"files": []}}}
|
||||
_groups, extra_dests = platform_region_groups(
|
||||
config, config["systems"], "emulators", db, "", profiles
|
||||
@@ -178,7 +179,7 @@ class FlatFirmwareFolder(unittest.TestCase):
|
||||
}
|
||||
db = {"files": files, "indexes": generate_db.build_indexes(files, {})}
|
||||
config = {
|
||||
"platform": "Flat", "verification_mode": "md5",
|
||||
"platform": "Flat", "version": "2.1", "verification_mode": "md5",
|
||||
"base_destination": "bios", "cores": ["psx"],
|
||||
"systems": {
|
||||
"psx": {"files": [{"name": "scph5501.bin",
|
||||
@@ -300,7 +301,7 @@ class OnePathCountsOnce(unittest.TestCase):
|
||||
common._emulator_profiles_cache.clear()
|
||||
self.addCleanup(common._emulator_profiles_cache.clear)
|
||||
profiles = common.load_emulator_profiles("emulators")
|
||||
config = {"platform": "P", "verification_mode": "existence", "cores": ["one", "two"],
|
||||
config = {"platform": "P", "version": "2.1", "verification_mode": "existence", "cores": ["one", "two"],
|
||||
"systems": {"amiga": {"files": []}}}
|
||||
report = verify_platform(config, db, "emulators", profiles)
|
||||
claims = [u for u in report["undeclared_files"] if u["name"] == "rom.key"]
|
||||
|
||||
Reference in new issue
Block a user