mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-15 06:23:47 -06:00
fix: resolve region holds with builder inputs
_ships and _emulator_ships resolved without the data directories, the archive index and the slot override the builder uses: 400 platform declarations and 178 emulator entries read as missing while the pack held them.
This commit is contained in:
1 parent
a99682beeb
commit
8d7b4cd4e4
5 files changed
+143
-25
No files matched your search
@@ -41,9 +41,66 @@ class ARefusedDumpHoldsNothing(unittest.TestCase):
|
||||
"by_path_suffix": {}},
|
||||
}
|
||||
entry = {"name": "us.bin", "md5": "0" * 32}
|
||||
self.assertFalse(_ships({"verification_mode": "md5"}, entry, db))
|
||||
self.assertTrue(_ships({"verification_mode": "existence"}, entry, db))
|
||||
self.assertTrue(_ships({"verification_mode": "md5"}, {"name": "us.bin"}, db))
|
||||
def ships(config: dict, fe: dict) -> bool:
|
||||
return _ships(config, fe, db, None, None, None)
|
||||
|
||||
self.assertFalse(ships({"verification_mode": "md5"}, entry))
|
||||
self.assertTrue(ships({"verification_mode": "existence"}, entry))
|
||||
self.assertTrue(ships({"verification_mode": "md5"}, {"name": "us.bin"}))
|
||||
|
||||
|
||||
class ADataDirectoryCopyIsHeld(unittest.TestCase):
|
||||
"""The region pass resolves with the builder's inputs.
|
||||
|
||||
Without the data directories, AmberELEC's config.ini (served from the
|
||||
bluemsx tree) and dolphin-mmjr2's nwc24msg.cfg (served from the Dolphin
|
||||
Sys tree) read as missing while both packs held them.
|
||||
"""
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
if not (REPO_ROOT / "data" / "bluemsx").is_dir() or not (
|
||||
REPO_ROOT / "data" / "dolphin-sys"
|
||||
).is_dir():
|
||||
raise unittest.SkipTest("data/ not refreshed")
|
||||
previous = os.getcwd()
|
||||
os.chdir(REPO_ROOT)
|
||||
try:
|
||||
from common import load_data_dir_registry, load_database
|
||||
from common import load_emulator_profiles, load_platform_config
|
||||
cls.db = load_database("database.json")
|
||||
cls.registry = load_data_dir_registry("platforms")
|
||||
cls.profiles = load_emulator_profiles("emulators")
|
||||
cls.amberelec = load_platform_config("amberelec", "platforms")
|
||||
finally:
|
||||
os.chdir(previous)
|
||||
|
||||
def setUp(self):
|
||||
previous = os.getcwd()
|
||||
os.chdir(REPO_ROOT)
|
||||
self.addCleanup(os.chdir, previous)
|
||||
|
||||
def test_platform_declaration_from_a_data_tree(self):
|
||||
entry = next(
|
||||
fe for fe in self.amberelec["systems"]["coleco-colecovision"]["files"]
|
||||
if fe["destination"].endswith("Dina/config.ini")
|
||||
)
|
||||
self.assertTrue(
|
||||
_ships(self.amberelec, entry, self.db, {}, self.registry, None)
|
||||
)
|
||||
|
||||
def test_emulator_entry_from_a_data_tree(self):
|
||||
from packextras import _emulator_ships
|
||||
from validation import _build_validation_index
|
||||
|
||||
profile = self.profiles["dolphin-mmjr2"]
|
||||
entry = next(
|
||||
fe for fe in profile["files"] if fe.get("name") == "nwc24msg.cfg"
|
||||
)
|
||||
index = _build_validation_index({"dolphin-mmjr2": profile})
|
||||
self.assertTrue(_emulator_ships(
|
||||
entry, "dolphin-mmjr2", profile, self.db, index, {}, self.registry,
|
||||
))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in new issue
Block a user