mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-10-20 18:59:07 -05:00
feat: install one emulator's files in one command
install.py --emulator NAME keeps what the named emulators read on the detected platform: their own files and the platform's files of the systems they run, as a pack built for them carries, without the systems no core is mapped to. Each emulator page now gives that command for Linux, macOS and Windows, beside the per-file links.
This commit is contained in:
1 parent
7c94a58825
commit
e424a35aee
7 files changed
+141
-2
No files matched your search
@@ -2902,6 +2902,39 @@ class ARefusedStandaloneCopyIsNamed(unittest.TestCase):
|
||||
|
||||
|
||||
|
||||
class OneEmulatorsFilesInOneCommand(unittest.TestCase):
|
||||
"""An emulator page offers one command for that emulator's files.
|
||||
--core kept the platform's whole list, and narrowing to cores kept the
|
||||
platform files of every system no core is mapped to."""
|
||||
|
||||
MANIFEST = {
|
||||
"system_cores": {"ibm-pc": ["pcem"], "nintendo-nes": ["fceumm"]},
|
||||
"core_names": {"pcem": ["pcem"], "fceumm": ["fceumm"]},
|
||||
"files": [],
|
||||
}
|
||||
|
||||
def test_only_its_files_and_its_systems(self):
|
||||
import contextlib # noqa: PLC0415
|
||||
|
||||
files = [
|
||||
{"dest": "pcem/ibmpc.bin", "cores": ["pcem"], "systems": ["ibm-pc"]},
|
||||
{"dest": "disksys.rom", "cores": None, "systems": ["nintendo-nes"]},
|
||||
{"dest": "ep128emu/exos.rom", "cores": None, "systems": ["enterprise"]},
|
||||
{"dest": "ibm.rom", "cores": None, "systems": ["ibm-pc"]},
|
||||
]
|
||||
with contextlib.redirect_stdout(io.StringIO()):
|
||||
kept, _omitted = install._narrow_to_emulators(
|
||||
["PCem"], self.MANIFEST, "retroarch", files, [])
|
||||
self.assertEqual(sorted(e["dest"] for e in kept), ["ibm.rom", "pcem/ibmpc.bin"])
|
||||
|
||||
def test_an_unknown_name_is_refused(self):
|
||||
import contextlib # noqa: PLC0415
|
||||
|
||||
with contextlib.redirect_stderr(io.StringIO()), self.assertRaises(SystemExit):
|
||||
install._narrow_to_emulators(["nope"], self.MANIFEST, "retroarch", [], [])
|
||||
|
||||
|
||||
|
||||
class ThePagesQuoteTheBootstrapsOwnWords(unittest.TestCase):
|
||||
"""The installer page and the FAQ quoted "install.py SHA-256 mismatch",
|
||||
a message the bootstraps no longer print."""
|
||||
|
||||
@@ -818,5 +818,22 @@ class ACardSaysWhyAFileIsLeftOut(unittest.TestCase):
|
||||
self.assertIn("installed with the standalone emulator", badges)
|
||||
|
||||
|
||||
class AnEmulatorPageOffersItsInstall(unittest.TestCase):
|
||||
"""An emulator page linked each file one by one and offered no way to
|
||||
install them together."""
|
||||
|
||||
def test_the_command_names_the_emulator(self):
|
||||
from generate_site import _install_block
|
||||
|
||||
text = "\n".join(_install_block("pcem", {"type": "libretro"}))
|
||||
self.assertIn("install.sh | sh -s -- --emulator pcem", text)
|
||||
self.assertIn("install.ps1))) --emulator pcem", text)
|
||||
self.assertEqual(_install_block("x", {"type": "alias"}), [])
|
||||
|
||||
def test_the_installer_takes_the_option(self):
|
||||
source = (ROOT / "install.py").read_text(encoding="utf-8")
|
||||
self.assertIn('"--emulator"', source)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user