fix: say a platform has no hardware targets

The error named platforms/targets/<name>.yml, which read as a file
missing from the repository (finding 63).
This commit is contained in:
Abdessamad Derraz committed 2026-11-05 11:42:46 +01:00
1 parent f3fe6f58b4
commit 609710e2d7
2 files changed
+27 -4

No files matched your search

+19 -3
View File
@@ -168,9 +168,6 @@ class HeldButNotPackedNamesEachReason(unittest.TestCase):
"in_pack": False, "omitted": reason, "category": category}
def _printed(self, entries: list[dict]) -> str:
import contextlib # noqa: PLC0415
import io # noqa: PLC0415
out = io.StringIO()
with contextlib.redirect_stdout(out):
verify._print_undeclared_section({"undeclared_files": entries}, False)
@@ -219,6 +216,25 @@ class HeldButNotPackedNamesEachReason(unittest.TestCase):
self.assertIn("Core files held but not packed: 2 (installed with its emulator)", text)
class APlatformWithoutTargetsSaysSo(unittest.TestCase):
"""`--platform misterfpga --target switch` printed 'No target config for
platform 'misterfpga': platforms/targets/misterfpga.yml', which reads as
a file missing from the repository."""
def test_the_message_names_the_reason_and_the_platforms_with_targets(self):
with tempfile.TemporaryDirectory() as tmp:
(Path(tmp) / "targets").mkdir()
for name in ("retroarch", "batocera", "_overrides"):
(Path(tmp) / "targets" / f"{name}.yml").write_text("targets: {}\n")
with self.assertRaises(FileNotFoundError) as caught:
common.load_target_config("misterfpga", "switch", tmp)
self.assertEqual(
str(caught.exception),
"misterfpga has no hardware targets: drop --target "
"(platforms with targets: batocera, retroarch)",
)
class OneSpellingPerOption(unittest.TestCase):
"""verify.py -p batocera worked and slots.py -p batocera was refused."""