fix: fail a named pack that is not built

This commit is contained in:
Abdessamad Derraz committed 2026-10-18 16:20:33 +02:00
1 parent 054682ae1e
commit def1e80232
2 files changed
+26 -4

No files matched your search

+9 -4
View File
@@ -2468,12 +2468,17 @@ def _run_verify_packs(args: argparse.Namespace) -> None:
for platform_name in platforms:
found = sorted(expected[platform_name] & on_disk)
if not found:
print(f" {platform_name}: SKIP (no pack in {args.output_dir})")
# Naming a platform is asking about its pack. Answering SKIP and
# exiting 0 says the pack passed; with --all, a platform whose pack
# was not built is genuinely out of scope.
# Naming a platform is asking about its pack: FAIL, with the
# command that builds it. With --all, a platform whose pack was
# not built is out of scope and skipped.
if args.platform:
print(
f" {platform_name}: FAIL (no pack in {args.output_dir}; build it with "
f"generate_pack.py --platform {platform_name} --output-dir {args.output_dir})"
)
all_ok = False
else:
print(f" {platform_name}: SKIP (no pack in {args.output_dir})")
continue
tc = _target_cores_for(platform_name, args.target, args.platforms_dir)
# A group pack and a pack built for the platform alone can both be
+17
View File
@@ -4951,5 +4951,22 @@ class ATargetIsNamedWhenItRemovesTheCore(unittest.TestCase):
self.assertNotIn("is not run by", result.stderr)
class ANamedPackThatIsAbsentFails(unittest.TestCase):
"""--verify-packs --platform retroarch on an empty directory printed
"SKIP" and exited 1: a skip label on a failure, and no next step."""
def test_the_line_says_fail_and_how_to_build(self):
with tempfile.TemporaryDirectory(dir=TMP_ROOT) as directory:
result = subprocess.run(
[sys.executable, "scripts/generate_pack.py", "--platform", "retroarch",
"--verify-packs", "--output-dir", directory],
cwd=ROOT, capture_output=True, text=True, timeout=600,
)
self.assertEqual(result.returncode, 1)
self.assertIn("retroarch: FAIL (no pack in", result.stdout)
self.assertIn("generate_pack.py --platform retroarch", result.stdout)
if __name__ == "__main__":
unittest.main()