diff --git a/scripts/generate_site.py b/scripts/generate_site.py index 0caabb92..b1a5626f 100644 --- a/scripts/generate_site.py +++ b/scripts/generate_site.py @@ -654,14 +654,22 @@ def build_emulator_gap_report( for k, v in profiles.items() if v.get("type") not in ("alias", "test") } - from common import standalone_set + from common import platform_declarations, standalone_set + from validation import case_folded_slots + # The command line passes these too: without them a RetroBat file named + # 32X_G_BIOS.BIN read as missing for a core opening 32X_G_BIOS.bin. + folded = frozenset().union(*( + case_folded_slots(cov["config"], platform_declarations(cov["config"], db)) + for cov in coverages.values() + )) return run_cross_reference( unique_profiles, declared, db, data_names=data_names, all_declared=all_declared, standalone_cores=set().union( *(standalone_set(cov["config"]) for cov in coverages.values()) ), + folded_slots=folded, ) diff --git a/tests/test_gap_settlement.py b/tests/test_gap_settlement.py index d86c4c4a..68304498 100644 --- a/tests/test_gap_settlement.py +++ b/tests/test_gap_settlement.py @@ -97,5 +97,25 @@ class TheRunningBuildPlacesTheGap(unittest.TestCase): self.assertEqual(self._gap_paths(set()), ["Cemu/keys.txt"]) +class EveryGapReportFoldsCase(unittest.TestCase): + """The command line passed folded_slots and the site did not, so the + gaps page listed RetroBat files the CLI report settled.""" + + def test_each_cross_reference_call_passes_the_folded_slots(self): + import ast + + for script in ("cross_reference.py", "generate_site.py"): + source = (REPO_ROOT / "scripts" / script).read_text(encoding="utf-8") + calls = [ + node for node in ast.walk(ast.parse(source)) + if isinstance(node, ast.Call) + and getattr(node.func, "id", "") in ("cross_reference", "run_cross_reference") + ] + with self.subTest(script=script): + self.assertTrue(calls) + for call in calls: + self.assertIn("folded_slots", {kw.arg for kw in call.keywords}) + + if __name__ == "__main__": unittest.main()