diff --git a/scripts/export_native.py b/scripts/export_native.py index dbdd2ee1..79e90cdd 100644 --- a/scripts/export_native.py +++ b/scripts/export_native.py @@ -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") diff --git a/tests/test_exporters.py b/tests/test_exporters.py index ce2822d1..108da118 100644 --- a/tests/test_exporters.py +++ b/tests/test_exporters.py @@ -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