mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-10-23 20:29:06 -05:00
fix: skip platforms with no native list
export_native counted MinUI, NextUI and MyMinUI as failures although the registry marks them native_list: none: their code names no BIOS file, so there is no list of theirs to correct.
This commit is contained in:
1 parent
1263f71e78
commit
e1aac191e7
2 files changed
+27
No files matched your search
@@ -42,6 +42,7 @@ from common import (
|
||||
load_database,
|
||||
load_emulator_profiles,
|
||||
load_platform_config,
|
||||
load_platform_registry,
|
||||
native_layer,
|
||||
require_platform,
|
||||
yaml_load,
|
||||
@@ -814,11 +815,17 @@ def run(
|
||||
refresh_only: bool = False,
|
||||
) -> int:
|
||||
exporters = discover_exporters()
|
||||
registry = load_platform_registry(platforms_dir)
|
||||
failures = 0
|
||||
skipped: list[str] = []
|
||||
|
||||
for platform in sorted(platforms):
|
||||
exporter_class = exporters.get(platform)
|
||||
if not exporter_class and (registry.get(platform) or {}).get("native_list") == "none":
|
||||
# The platform's code names no BIOS file: there is no list of its
|
||||
# own to hand back corrected.
|
||||
print(f" SKIP {platform}: names no BIOS file of its own (native_list: none)")
|
||||
continue
|
||||
if not exporter_class:
|
||||
skipped.append(platform)
|
||||
print(f" SKIP {platform}: no exporter")
|
||||
|
||||
@@ -565,6 +565,26 @@ class ExporterRegistry(unittest.TestCase):
|
||||
)
|
||||
self.assertEqual(registered - set(exporters) - _without_native_list(), set())
|
||||
|
||||
def test_a_run_over_a_platform_without_a_native_list_passes(self):
|
||||
"""export_native --all ran over MinUI, NextUI and MyMinUI and failed
|
||||
the pipeline step for three platforms the registry says have nothing
|
||||
to export. A platform with no exporter and no such mark still fails."""
|
||||
import contextlib
|
||||
|
||||
import export_native
|
||||
|
||||
with tempfile.TemporaryDirectory(dir=REPO_ROOT / "tmp") as directory:
|
||||
platforms = Path(directory)
|
||||
(platforms / "_registry.yml").write_text(
|
||||
"platforms:\n cardonly:\n native_list: none\n unwritten: {}\n",
|
||||
encoding="utf-8")
|
||||
with contextlib.redirect_stdout(io.StringIO()) as out:
|
||||
self.assertEqual(export_native.run(
|
||||
["cardonly"], directory, directory, str(platforms), directory, False), 0)
|
||||
self.assertEqual(export_native.run(
|
||||
["unwritten"], directory, directory, str(platforms), directory, False), 1)
|
||||
self.assertIn("SKIP cardonly: names no BIOS file of its own", out.getvalue())
|
||||
|
||||
def test_a_platform_without_a_native_list_declares_no_file(self):
|
||||
"""`native_list: none` says the platform's code names no BIOS file
|
||||
(MinUI hands each core a folder and opens nothing in it). A platform
|
||||
|
||||
Reference in new issue
Block a user