fix: name the target that removes a core

This commit is contained in:
Abdessamad Derraz committed 2026-10-18 16:19:19 +02:00
1 parent 10cfdb4de0
commit 737e917119
2 files changed
+25

No files matched your search

+9
View File
@@ -830,10 +830,19 @@ def main() -> None:
)
config = load_platform_config(args.platform, args.platforms_dir)
relevant = resolve_platform_cores(config, profiles, target_cores=target_cores)
run_anywhere = (
set(resolve_platform_cores(config, profiles)) if args.target else relevant
)
profiles = {k: v for k, v in profiles.items() if k in relevant}
standalone_cores = standalone_set(config)
if not profiles:
if args.emulator and args.target and set(args.emulator.split(",")) & run_anywhere:
raise SystemExit(
f"ERROR: {args.emulator} is not built for {args.platform}'s "
f"{args.target} target; {args.platform} runs it elsewhere "
f"(drop --target to see its files)"
)
if args.emulator:
raise SystemExit(f"ERROR: {args.emulator} is not run by {args.platform}")
print(f"{args.platform or 'The tree'} runs no profiled emulator.", file=sys.stderr)
+16
View File
@@ -4935,5 +4935,21 @@ class TheReadmeCountsSystemsAsListSystemsDoes(unittest.TestCase):
self.assertEqual(announced, listed)
class ATargetIsNamedWhenItRemovesTheCore(unittest.TestCase):
"""--platform batocera --target rpi4 --emulator dolphin said "dolphin is
not run by batocera", which runs it on every x86 board."""
def test_the_message_names_the_target(self):
result = subprocess.run(
[sys.executable, "scripts/cross_reference.py", "--platform", "batocera",
"--target", "bcm2711", "--emulator", "dolphin"],
cwd=ROOT, capture_output=True, text=True, timeout=600,
)
self.assertEqual(result.returncode, 1)
self.assertIn("bcm2711 target", result.stderr)
self.assertNotIn("is not run by", result.stderr)
if __name__ == "__main__":
unittest.main()