From def1e802326b3465504d6de035f3ea65cf168f7c Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Sun, 18 Oct 2026 16:20:33 +0200 Subject: [PATCH] fix: fail a named pack that is not built --- scripts/generate_pack.py | 13 +++++++++---- tests/test_audit_regressions.py | 17 +++++++++++++++++ 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/scripts/generate_pack.py b/scripts/generate_pack.py index af888589..7ae6912e 100644 --- a/scripts/generate_pack.py +++ b/scripts/generate_pack.py @@ -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 diff --git a/tests/test_audit_regressions.py b/tests/test_audit_regressions.py index 37e11a87..0bf569c8 100644 --- a/tests/test_audit_regressions.py +++ b/tests/test_audit_regressions.py @@ -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()