From 14dc75c6fbb356e5bf06c51b0ad82195a7ec1389 Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Mon, 23 Nov 2026 22:24:50 +0100 Subject: [PATCH] fix: data trees read the bundled predicate --- scripts/resolve/truth.py | 2 +- tests/test_truth_data_dir_readers.py | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/scripts/resolve/truth.py b/scripts/resolve/truth.py index c20227b71..17e1387c8 100644 --- a/scripts/resolve/truth.py +++ b/scripts/resolve/truth.py @@ -596,7 +596,7 @@ def _fold_data_directory_readers( # lists its resources, pcee2 lists patches.zip alone # (its build compiles GameIndex.yaml and the shaders in). continue - installed = platform_name in (tree.get("installed_on") or []) + installed = installed_with_emulator(tree, platform_name) for path, entries in by_path.items(): if not path.startswith(prefix): continue diff --git a/tests/test_truth_data_dir_readers.py b/tests/test_truth_data_dir_readers.py index a2704ce92..7b36a00da 100644 --- a/tests/test_truth_data_dir_readers.py +++ b/tests/test_truth_data_dir_readers.py @@ -92,6 +92,19 @@ class DataDirectoryReaders(unittest.TestCase): self.assertEqual(entry["_cores"], ["armsx2", "lrps2"]) self.assertNotIn("hash_conflict", entry) + def test_a_bundled_tree_brings_the_file_as_a_bundled_file_does(self): + """The tree read installed_on alone: a tree the emulator ships + (bundled: true) counted its reader among those the platform must + supply, so the entry asked for a file the emulator installs.""" + self.profiles["armsx2"]["files"][0]["bundled"] = True + self.profiles["lrps2"]["data_directories"][0]["bundled"] = True + entry = self._entry(self.registry) + self.assertEqual(entry["_cores"], ["armsx2", "lrps2"]) + self.assertEqual(entry["_brought_by"], []) + self.assertTrue(entry.get("bundled")) + self.profiles["lrps2"]["data_directories"][0]["not_bundled_on"] = ["plat"] + self.assertEqual(self._entry(self.registry)["_brought_by"], ["lrps2:libretro"]) + def test_the_gaps_page_hands_truth_its_own_registry(self): """The divergence table folded the checked-out repository's _data_dirs.yml under generate_site --platforms-dir."""