mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-14 22:13:47 -06:00
feat: record config installs in shell extractors
ROCKNIX, EmuELEC, AmberELEC, EmuDeck and RetroDECK records citing a config now carry the code installing it, whether that keeps a file already there, and the launch code rewriting its keys. Rescraped at the pinned revisions. Records the shipped code never reads are no longer written: EmuELEC's mame.ini folders (MAME.opt turns paths off), AmberELEC's atari800.cfg (read only under an option that is off), the six RetroDECK XRoar ROM lists no machine looks up, and the ROCKNIX melonDS DSi BIOS keys (DSiExternalBIOSEnable is set by no shipped ini). Conditions added: ROCKNIX and AmberELEC amiberry kickstarts hold only outside a WHDLoad --autoload boot, ROCKNIX NanoBoyAdvance exits without its BIOS, the EmuELEC scummvm.ini copy runs from an action no launch passes, and the EmuDeck melonDS.toml keys need ExternalBIOSEnable (DS) or ConsoleType 1 (DSi).
This commit is contained in:
1 parent
3129eaf10c
commit
c5d3e85bac
16 files changed
+1153
-418
No files matched your search
@@ -105,22 +105,6 @@ HATARI_CFG = text(
|
||||
"""
|
||||
)
|
||||
|
||||
ATARI800_CFG = text(
|
||||
"""
|
||||
Atari 800 Emulator, Version 3.1.0
|
||||
ROM_OS_A_NTSC=
|
||||
ROM_OS_A_PAL=/storage/roms/bios/ATARIOSA.ROM
|
||||
ROM_5200=/storage/roms/bios/5200.rom
|
||||
"""
|
||||
)
|
||||
|
||||
ATARI800_PATCH = text(
|
||||
"""
|
||||
+ LDFLAGS += -static-libgcc
|
||||
+ CFLAGS += -DDEFAULT_CFG_NAME="\\"/storage/.config/distribution/configs/atari800.cfg\\""
|
||||
"""
|
||||
)
|
||||
|
||||
AMIBERRY_MK = text(
|
||||
"""
|
||||
makeinstall_target() {
|
||||
@@ -141,6 +125,17 @@ AMIBERRY_SH = text(
|
||||
cp $AMIBERRY_CONFIG_DIR/AmigaA500-default.uae "$AMIBERRY_TMP_CONFIG"
|
||||
fi
|
||||
}
|
||||
amiberry -f "$AMIBERRY_TMP_CONFIG" --autoload "$1" >> $AMIBERRY_LOG 2>&1
|
||||
"""
|
||||
)
|
||||
|
||||
USERCONFIG = text(
|
||||
"""
|
||||
#!/bin/bash
|
||||
if [ ! -e "/storage/.configured" ]
|
||||
then
|
||||
rsync -a --ignore-existing --exclude=es_systems.cfg /usr/config/* /storage/.config/ || exit 1
|
||||
fi
|
||||
"""
|
||||
)
|
||||
|
||||
@@ -195,8 +190,7 @@ def tree(**overrides: str) -> dict[str, str]:
|
||||
al.SCRIPTS["piemu"]: PIEMU,
|
||||
al.SCRIPTS["HATARISA"]: HATARI_SH,
|
||||
al.HATARI_CONFIG: HATARI_CFG,
|
||||
al.ATARI800_CONFIG: ATARI800_CFG,
|
||||
al.ATARI800_PATCH: ATARI800_PATCH,
|
||||
al.USERCONFIG: USERCONFIG,
|
||||
al.AMIBERRY_PACKAGE: AMIBERRY_MK,
|
||||
al.SCRIPTS["AMIBERRY"]: AMIBERRY_SH,
|
||||
f"{al.AMIBERRY_CONFIGS}/AmigaA1200-default.uae": uae("kick40068.A1200.rom"),
|
||||
@@ -218,6 +212,13 @@ class Frontends(unittest.TestCase):
|
||||
(record,) = al.retroarch(read())
|
||||
self.assertEqual(record.search_dir, "~/roms/bios")
|
||||
self.assertEqual(record.source_ref, f"{al.RETROARCH_CFG}:2")
|
||||
# The first boot copies /usr/config and leaves a file already there.
|
||||
self.assertEqual(record.installs, {
|
||||
"path": "/storage/.config/retroarch/retroarch.cfg",
|
||||
"source_ref": f"{al.USERCONFIG}:4",
|
||||
})
|
||||
self.assertIs(record.kept_if_present, True)
|
||||
self.assertEqual(record.overrides, [])
|
||||
|
||||
def test_retrorun_directory(self):
|
||||
(record,) = al.retrorun(read())
|
||||
@@ -266,6 +267,9 @@ class Standalone(unittest.TestCase):
|
||||
record.source_ref,
|
||||
f"{al.RUNEMU}:3, {al.SCRIPTS['HATARISA']}:3-4, {al.HATARI_CONFIG}:2",
|
||||
)
|
||||
# Copied over at each launch: nothing the user edits survives.
|
||||
self.assertEqual(record.installs["source_ref"], f"{al.SCRIPTS['HATARISA']}:3")
|
||||
self.assertIs(record.kept_if_present, False)
|
||||
|
||||
def test_amiberry_link_and_one_kickstart_per_config(self):
|
||||
link, a1200, a500 = al.amiberry(read(), al.Runemu(read()))
|
||||
@@ -273,7 +277,11 @@ class Standalone(unittest.TestCase):
|
||||
self.assertEqual(link.passes_to, "/usr/config/amiberry/kickstarts is a symlink to it")
|
||||
self.assertEqual((a1200.slot, a1200.names), ("A1200", ["kick40068.A1200.rom"]))
|
||||
self.assertEqual((a500.slot, a500.names), ("A500", ["kick34005.A500.rom"]))
|
||||
self.assertEqual(a500.depends_on_option, f"not ({a1200.depends_on_option})")
|
||||
self.assertTrue(a500.depends_on_option.startswith("not ("))
|
||||
# A WHDLoad boot replaces the setup the config gives.
|
||||
self.assertIn("--autoload", a1200.depends_on_option)
|
||||
self.assertEqual(a1200.installs["source_ref"], f"{al.SCRIPTS['AMIBERRY']}:5")
|
||||
self.assertEqual(a500.installs["source_ref"], f"{al.SCRIPTS['AMIBERRY']}:7")
|
||||
|
||||
def test_a_table_running_another_script_raises(self):
|
||||
broken = RUNEMU.replace("/usr/bin/yabasanshiro.sh", "/usr/bin/yaba.sh")
|
||||
@@ -287,15 +295,9 @@ class Standalone(unittest.TestCase):
|
||||
|
||||
|
||||
class Cores(unittest.TestCase):
|
||||
def test_atari800_built_to_read_the_shipped_config(self):
|
||||
(record,) = al.atari800(read())
|
||||
self.assertEqual(record.names, ["ATARIOSA.ROM", "5200.rom"])
|
||||
self.assertEqual(record.source_ref, f"{al.ATARI800_PATCH}:2, {al.ATARI800_CONFIG}:3-4")
|
||||
|
||||
def test_atari800_built_for_another_config_raises(self):
|
||||
broken = ATARI800_PATCH.replace("atari800.cfg", "other.cfg")
|
||||
with self.assertRaises(LauncherShapeError):
|
||||
al.atari800(read(**{al.ATARI800_PATCH: broken}))
|
||||
def test_atari800_config_is_no_record(self):
|
||||
# The core reads atari800.cfg only under an option that is off.
|
||||
self.assertFalse(any(r["emulator"] == "atari800" for r in al.extract_launchers(read())))
|
||||
|
||||
def test_scummvm_paths_written_under_bios(self):
|
||||
theme, extra = al.scummvm(read())
|
||||
@@ -319,7 +321,7 @@ class Cores(unittest.TestCase):
|
||||
def test_every_extractor_runs_on_the_fixture(self):
|
||||
records = al.extract_launchers(read())
|
||||
# One easyrpg runtime in the fixture, two at the pinned commit.
|
||||
self.assertEqual(len(records), 16)
|
||||
self.assertEqual(len(records), 15)
|
||||
|
||||
|
||||
class PlatformFile(unittest.TestCase):
|
||||
|
||||
@@ -40,6 +40,9 @@ ARES_SH = text(
|
||||
UserBIOSPath='/home/deck/Emulation/bios/'
|
||||
sed -i "s|$UserBIOSPath|${biosPath}\\/|g" "$ares_configFile"
|
||||
}
|
||||
ares_init(){
|
||||
configEmuFP "${ares_emuName}" "${ares_emuPath}" "true"
|
||||
}
|
||||
"""
|
||||
)
|
||||
|
||||
@@ -87,6 +90,9 @@ MELONDS_SH = text(
|
||||
buttonA='Joy_A='
|
||||
changeLine "$buttonA" "$buttonA""0" "${melonDS_configFile}"
|
||||
}
|
||||
melonDS_update(){
|
||||
configEmuFP "${melonDS_emuName}" "${melonDS_emuPath}"
|
||||
}
|
||||
"""
|
||||
)
|
||||
|
||||
@@ -103,6 +109,7 @@ MELONDS_TOML = text(
|
||||
LastROMFolder = "/run/media/mmcblk0p1/Emulation/roms/ds"
|
||||
[Emu]
|
||||
ExternalBIOSEnable = false
|
||||
ConsoleType = 0
|
||||
[DS]
|
||||
FirmwarePath = "/run/media/mmcblk0p1/Emulation/bios/firmware.bin"
|
||||
BIOS7Path = "/run/media/mmcblk0p1/Emulation/bios/bios7.bin"
|
||||
@@ -206,8 +213,23 @@ SHADPS4_SH = text(
|
||||
)
|
||||
|
||||
|
||||
CONFIG_EMU_FP = text(
|
||||
"""
|
||||
configEmuFP(){
|
||||
if [[ $overwrite == 'true' ]]; then
|
||||
overwrite="--backup --suffix=.bak"
|
||||
else
|
||||
overwrite="--ignore-existing"
|
||||
fi
|
||||
rsync -avhp --mkpath "$emudeckBackend/configs/${ID}" "$HOME/.var/app/" $overwrite
|
||||
}
|
||||
"""
|
||||
)
|
||||
|
||||
|
||||
def tree(**scripts: str) -> RepoTree:
|
||||
files = {f"{S}/{name}": body for name, body in scripts.items()}
|
||||
files[el.CONFIG_EMU_FP] = CONFIG_EMU_FP
|
||||
files[f"{el.CONFIGS}/dev.ares.ares/data/ares/settings.bml"] = ARES_BML
|
||||
files[f"{el.CONFIGS}/net.kuribo64.melonDS/config/melonDS/melonDS.ini"] = MELONDS_INI
|
||||
files[f"{el.CONFIGS}/net.kuribo64.melonDS/config/melonDS/melonDS.toml"] = MELONDS_TOML
|
||||
@@ -253,8 +275,17 @@ class WrittenIntoTheConfig(unittest.TestCase):
|
||||
self.assertEqual(
|
||||
toml["passes_to"], "melonDS.toml [DS] FirmwarePath, BIOS7Path [DSi] NANDPath"
|
||||
)
|
||||
# The DS keys wait for ExternalBIOSEnable, the DSi keys for a DSi.
|
||||
self.assertEqual(
|
||||
toml["depends_on_option"], "ExternalBIOSEnable = false in the shipped melonDS.toml"
|
||||
toml["depends_on_option"],
|
||||
"[DS] keys: ExternalBIOSEnable = true, false in the shipped melonDS.toml; "
|
||||
"[DSi] keys: ConsoleType = 1, 0 in the shipped melonDS.toml",
|
||||
)
|
||||
# configEmuFP's update call passes --ignore-existing.
|
||||
self.assertIs(toml["kept_if_present"], True)
|
||||
self.assertEqual(
|
||||
toml["installs"]["path"],
|
||||
"${HOME}/.var/app/net.kuribo64.melonDS/config/melonDS/melonDS.toml",
|
||||
)
|
||||
|
||||
def test_a_config_the_setters_rewrite_keeps_their_values(self):
|
||||
|
||||
@@ -228,6 +228,9 @@ DUCKSTATION_SH = text(
|
||||
"""
|
||||
CONFIG_DIR="/emuelec/configs/duckstation"
|
||||
duckstation-nogui -fullscreen -settings "${CONFIG_DIR}/settings.ini" -- "${1}"
|
||||
if [ ! -d "${CONFIG_DIR}" ]; then
|
||||
cp -rf /usr/config/emuelec/configs/duckstation/* "${CONFIG_DIR}"
|
||||
fi
|
||||
"""
|
||||
)
|
||||
|
||||
@@ -319,6 +322,9 @@ ADVMAME_SH = text(
|
||||
sed -i "s|/roms/arcade|/roms/mame|g" ${CONFIG_DIR}/advmame.rc
|
||||
fi
|
||||
SDL_AUDIODRIVER=alsa advmame ${ARG} -quiet
|
||||
if [ ! -d "${CONFIG_DIR}" ]; then
|
||||
cp -rf /usr/config/emuelec/configs/advmame/* "${CONFIG_DIR}/"
|
||||
fi
|
||||
"""
|
||||
)
|
||||
|
||||
@@ -480,24 +486,12 @@ class LibretroRecords(unittest.TestCase):
|
||||
self.assertEqual(jar["passes_to"], "${HOME}/roms/bios")
|
||||
self.assertEqual(jar["depends_on_option"], "/storage/roms/bios/jdk/eeversion exists")
|
||||
|
||||
def test_mame_copies_its_own_files_and_reads_only_path_options(self):
|
||||
def test_mame_copies_its_own_files_and_hands_no_folder(self):
|
||||
# The core passes no path option and reads no mame.ini: only the
|
||||
# copies are the launcher's.
|
||||
found = records(el.mame)
|
||||
copies = [r for r in found if r["kind"] == "copies"]
|
||||
self.assertEqual([r["names"] for r in copies], [["fm*"], ["mame*"]])
|
||||
folders = [(r["passes_to"], r["search_dir"]) for r in found if r["kind"] == "passes_path"]
|
||||
self.assertEqual(
|
||||
folders,
|
||||
[
|
||||
("mame.ini rompath", "/storage/roms/bios/mame/bios"),
|
||||
("mame.ini samplepath", "/storage/roms/bios/mame/samples"),
|
||||
],
|
||||
)
|
||||
self.assertTrue(all(r["depends_on_option"] == "mame_read_config = enabled"
|
||||
for r in found if r["kind"] == "passes_path"))
|
||||
|
||||
def test_mame_without_the_read_config_option_raises(self):
|
||||
with self.assertRaises(LauncherPatternMissing):
|
||||
records(el.mame, **{f"{el.LIBRETRO}/mame/config/MAME/MAME.opt": "x = 1\n"})
|
||||
self.assertEqual([r["kind"] for r in found], ["copies", "copies"])
|
||||
self.assertEqual([r["names"] for r in found], [["fm*"], ["mame*"]])
|
||||
|
||||
|
||||
class StandaloneRecords(unittest.TestCase):
|
||||
@@ -546,6 +540,12 @@ class StandaloneRecords(unittest.TestCase):
|
||||
(record,) = records(el.duckstation)
|
||||
self.assertEqual((record["kind"], record["search_dir"]), ("scans_dir", "/storage/roms/bios"))
|
||||
|
||||
def test_duckstation_config_is_kept_when_present(self):
|
||||
(record,) = records(el.duckstation)
|
||||
self.assertEqual(record["installs"]["path"], "/emuelec/configs/duckstation/settings.ini")
|
||||
self.assertIs(record["kept_if_present"], True)
|
||||
self.assertEqual(record["overrides"], [])
|
||||
|
||||
def test_duckstation_with_a_fixed_bios_path_raises(self):
|
||||
changed = DUCKSTATION_INI.replace("PathPAL =", "PathPAL = /storage/roms/bios/scph5502.bin")
|
||||
with self.assertRaises(LauncherPatternMissing):
|
||||
@@ -631,7 +631,8 @@ class StandaloneRecords(unittest.TestCase):
|
||||
|
||||
def test_every_extractor_runs_on_the_fixtures(self):
|
||||
found = el.extract_launchers(tree())
|
||||
self.assertEqual(len(found), 28)
|
||||
# The two mame.ini folders are no longer records.
|
||||
self.assertEqual(len(found), 26)
|
||||
|
||||
|
||||
class Revision(unittest.TestCase):
|
||||
|
||||
@@ -85,13 +85,14 @@ MELONDS_SH = text(
|
||||
sed -i '/^ExternalBIOSEnable=/c\\ExternalBIOSEnable=0' /storage/.config/melonDS/melonDS.ini
|
||||
fi
|
||||
fi
|
||||
CONF_DIR="/storage/.config/melonDS"
|
||||
"""
|
||||
)
|
||||
|
||||
|
||||
def melonds_tree() -> RepoTree:
|
||||
pkg = f"{SA}/melonds-sa"
|
||||
return RepoTree.from_files(
|
||||
return rocknix_tree(
|
||||
{
|
||||
**devices("AMD64", "H700", "RK3576", "S922X"),
|
||||
f"{pkg}/package.mk": MELONDS_MK,
|
||||
@@ -148,6 +149,7 @@ AMIBERRY_SH = text(
|
||||
cp -rf /usr/config/amiberry ${AMIBERRY_DIR}
|
||||
fi
|
||||
cd ${AMIBERRY_DIR}
|
||||
amiberry -f "${AMIBERRY_TMP_CONFIG}" --autoload "$1" >> ${AMIBERRY_LOG} 2>&1
|
||||
"""
|
||||
)
|
||||
|
||||
@@ -291,6 +293,22 @@ FLYCAST_SH = text(
|
||||
)
|
||||
|
||||
|
||||
USERCONFIG = text(
|
||||
"""
|
||||
#!/bin/bash
|
||||
if [ ! -e "/storage/.configured" ]
|
||||
then
|
||||
rsync -a --ignore-existing --exclude={es_features.cfg,es_systems.cfg} /usr/config/* /storage/.config/ >/var/log/configure.log 2>&1
|
||||
fi
|
||||
"""
|
||||
)
|
||||
|
||||
|
||||
def rocknix_tree(files: dict[str, str], links: dict[str, str] | None = None) -> RepoTree:
|
||||
"""A ROCKNIX tree holding the first-boot copy every config record cites."""
|
||||
return RepoTree.from_files({rl.USERCONFIG: USERCONFIG, **files}, links)
|
||||
|
||||
|
||||
def by(records: list[dict], emulator: str) -> list[dict]:
|
||||
return [r for r in records if r["emulator"] == emulator]
|
||||
|
||||
@@ -302,23 +320,26 @@ class ConfigsPerDevice(unittest.TestCase):
|
||||
empty, named = records
|
||||
self.assertEqual(empty["names"], [])
|
||||
self.assertTrue(empty["passes_to"].endswith("DSiNANDPath left empty"))
|
||||
# melonDS opens the DSi BIOS and firmware keys only under
|
||||
# DSiExternalBIOSEnable, which no shipped config sets.
|
||||
self.assertEqual(
|
||||
named["names"],
|
||||
[
|
||||
"bios9.bin",
|
||||
"bios7.bin",
|
||||
"firmware.bin",
|
||||
"dsi_bios9.bin",
|
||||
"dsi_bios7.bin",
|
||||
"dsi_firmware.bin",
|
||||
"dsi_nand.bin",
|
||||
],
|
||||
named["names"], ["bios9.bin", "bios7.bin", "firmware.bin", "dsi_nand.bin"]
|
||||
)
|
||||
self.assertEqual(named["search_dir"], "/storage/roms/bios")
|
||||
self.assertEqual(named["installs"]["path"], "/storage/.config/melonDS/melonDS.ini")
|
||||
self.assertIs(named["kept_if_present"], True)
|
||||
self.assertEqual(named["overrides"], [])
|
||||
|
||||
def test_a_config_setting_the_dsi_switch_keeps_the_dsi_keys(self):
|
||||
tree = melonds_tree()
|
||||
path = f"{SA}/melonds-sa/config/S922X/melonDS.ini"
|
||||
tree._texts[path] = tree.read(path) + "DSiExternalBIOSEnable=1\n"
|
||||
named = rl.melonds(tree)[1].entry()
|
||||
self.assertIn("dsi_bios9.bin", named["names"])
|
||||
|
||||
def test_a_linked_device_directory_reads_its_target(self):
|
||||
named = rl.melonds(melonds_tree())[1].entry()
|
||||
self.assertIn(f"{SA}/melonds-sa/config/InputPlumber/melonDS.ini:2-8", named["source_ref"])
|
||||
self.assertIn(f"{SA}/melonds-sa/config/InputPlumber/melonDS.ini:2-4, 8", named["source_ref"])
|
||||
self.assertNotIn("config/RK3576", named["source_ref"])
|
||||
|
||||
def test_the_external_bios_switch_is_the_option(self):
|
||||
@@ -330,11 +351,14 @@ class ConfigsPerDevice(unittest.TestCase):
|
||||
|
||||
def test_identical_configs_give_one_record_without_device(self):
|
||||
pkg = f"{SA}/dsperate-sa"
|
||||
tree = RepoTree.from_files(
|
||||
tree = rocknix_tree(
|
||||
{
|
||||
**devices("H700", "RK3576", "S922X"),
|
||||
f"{pkg}/package.mk": DSPERATE_MK,
|
||||
f"{pkg}/scripts/start_dsperate.sh": '${EMUPERF} /usr/bin/dsperate --config "${DSPERATE_INI}" "${ROM}"\n',
|
||||
f"{pkg}/scripts/start_dsperate.sh": (
|
||||
'${EMUPERF} /usr/bin/dsperate --config "${DSPERATE_INI}" "${ROM}"\n'
|
||||
'DSPERATE_INI="/storage/.config/dsperate/dsperate.ini"\n'
|
||||
),
|
||||
f"{pkg}/config/H700/dsperate.ini": DSPERATE_INI,
|
||||
f"{pkg}/config/InputPlumber/dsperate.ini": DSPERATE_INI,
|
||||
f"{pkg}/config/S922X/dsperate.ini": DSPERATE_INI,
|
||||
@@ -352,10 +376,11 @@ class ConfigsPerDevice(unittest.TestCase):
|
||||
|
||||
def test_an_absent_key_and_an_empty_one_hand_over_the_same(self):
|
||||
pkg = f"{SA}/duckstation-sa"
|
||||
tree = RepoTree.from_files(
|
||||
tree = rocknix_tree(
|
||||
{
|
||||
**devices("AMD64", "S922X"),
|
||||
f"{pkg}/package.mk": DUCKSTATION_MK,
|
||||
f"{pkg}/scripts/start_duckstation.sh": "#!/bin/bash\n",
|
||||
f"{pkg}/config/AMD64/settings.ini": "[BIOS]\nSearchDirectory = /storage/roms/bios\n",
|
||||
f"{pkg}/config/S922X/settings.ini": text(
|
||||
"""
|
||||
@@ -375,10 +400,11 @@ class ConfigsPerDevice(unittest.TestCase):
|
||||
|
||||
def test_a_bios_written_into_a_path_key_is_an_unknown_shape(self):
|
||||
pkg = f"{SA}/duckstation-sa"
|
||||
tree = RepoTree.from_files(
|
||||
tree = rocknix_tree(
|
||||
{
|
||||
**devices("S922X"),
|
||||
f"{pkg}/package.mk": DUCKSTATION_MK,
|
||||
f"{pkg}/scripts/start_duckstation.sh": "#!/bin/bash\n",
|
||||
f"{pkg}/config/S922X/settings.ini": "[BIOS]\nSearchDirectory = /storage/roms/bios\nPathNTSCU = scph5501.bin\n",
|
||||
}
|
||||
)
|
||||
@@ -387,7 +413,7 @@ class ConfigsPerDevice(unittest.TestCase):
|
||||
|
||||
def test_a_package_without_a_device_copy_raises(self):
|
||||
pkg = f"{SA}/duckstation-sa"
|
||||
tree = RepoTree.from_files(
|
||||
tree = rocknix_tree(
|
||||
{
|
||||
**devices("S922X"),
|
||||
f"{pkg}/package.mk": "makeinstall_target() {\n true\n}\n",
|
||||
@@ -402,7 +428,7 @@ class NamesTheConfigsFix(unittest.TestCase):
|
||||
def test_amiberry_machine_follows_the_game_name(self):
|
||||
pkg = f"{SA}/amiberry"
|
||||
uae = "amiberry.rom_path=/storage/.config/amiberry/kickstarts/\nkickstart_rom_file=@BIOS_PATH@/{}\nkickstart_ext_rom_file=\n"
|
||||
tree = RepoTree.from_files(
|
||||
tree = rocknix_tree(
|
||||
{
|
||||
f"{pkg}/scripts/start_amiberry.sh": AMIBERRY_SH,
|
||||
f"{pkg}/package.mk": AMIBERRY_MK,
|
||||
@@ -412,9 +438,15 @@ class NamesTheConfigsFix(unittest.TestCase):
|
||||
)
|
||||
a1200, a500, link, entered, copied = (r.entry() for r in rl.amiberry(tree))
|
||||
self.assertEqual((a1200["slot"], a1200["names"]), ("A1200", ["kick40068.A1200.rom"]))
|
||||
self.assertEqual(a1200["depends_on_option"], "game name matches AGA|CD32")
|
||||
self.assertEqual(
|
||||
a1200["depends_on_option"],
|
||||
"game name matches AGA|CD32, content not booted with --autoload, "
|
||||
"a WHDLoad .lha or .zip (start_amiberry.sh:17)",
|
||||
)
|
||||
self.assertEqual(a1200["installs"]["path"], "${AMIBERRY_TMP_CONFIG}")
|
||||
self.assertIs(a1200["kept_if_present"], False)
|
||||
self.assertEqual((a500["slot"], a500["names"]), ("A500", ["kick34005.A500.rom"]))
|
||||
self.assertEqual(a500["depends_on_option"], "game name does not match AGA|CD32")
|
||||
self.assertTrue(a500["depends_on_option"].startswith("game name does not match AGA|CD32"))
|
||||
self.assertEqual(a500["search_dir"], "/storage/roms/bios")
|
||||
self.assertEqual(
|
||||
a1200["source_ref"],
|
||||
@@ -443,7 +475,7 @@ class NamesTheConfigsFix(unittest.TestCase):
|
||||
|
||||
def test_mednafen_one_record_per_module(self):
|
||||
pkg = f"{SA}/mednafen"
|
||||
tree = RepoTree.from_files(
|
||||
tree = rocknix_tree(
|
||||
{
|
||||
f"{pkg}/config/common/mednafen.template": MEDNAFEN_TEMPLATE,
|
||||
f"{pkg}/scripts/start_mednafen.sh": MEDNAFEN_SH,
|
||||
@@ -461,7 +493,7 @@ class NamesTheConfigsFix(unittest.TestCase):
|
||||
|
||||
def test_mednafen_without_a_firmware_directory_raises(self):
|
||||
pkg = f"{SA}/mednafen"
|
||||
tree = RepoTree.from_files(
|
||||
tree = rocknix_tree(
|
||||
{
|
||||
f"{pkg}/config/common/mednafen.template": "psx.bios_eu scph5502.bin\n",
|
||||
f"{pkg}/scripts/start_mednafen.sh": MEDNAFEN_SH,
|
||||
@@ -473,7 +505,7 @@ class NamesTheConfigsFix(unittest.TestCase):
|
||||
|
||||
class SearchedNames(unittest.TestCase):
|
||||
def tree(self, script: str) -> RepoTree:
|
||||
return RepoTree.from_files({f"{SA}/yabasanshiro-sa/scripts/start_yabasanshiro.sh": script})
|
||||
return rocknix_tree({f"{SA}/yabasanshiro-sa/scripts/start_yabasanshiro.sh": script})
|
||||
|
||||
def test_yabasanshiro_tries_its_names_in_order(self):
|
||||
(record,) = [r.entry() for r in rl.yabasanshiro(self.tree(YABASANSHIRO_SH))]
|
||||
@@ -514,7 +546,7 @@ class Links(unittest.TestCase):
|
||||
|
||||
def tree(self) -> RepoTree:
|
||||
scripts = self.all_scripts()
|
||||
return RepoTree.from_files({p: scripts[e] for e, p in rl.LINK_SCRIPTS})
|
||||
return rocknix_tree({p: scripts[e] for e, p in rl.LINK_SCRIPTS})
|
||||
|
||||
def emulator(self, name: str) -> list[dict]:
|
||||
return by([r.entry() for r in rl.links(self.tree())], name)
|
||||
@@ -566,7 +598,7 @@ class Links(unittest.TestCase):
|
||||
def test_a_script_without_a_bios_link_raises(self):
|
||||
scripts = self.all_scripts()
|
||||
scripts["flycast"] = 'ln -sf "/storage/.config/flycast" "/storage/.local/share/flycast"\n'
|
||||
tree = RepoTree.from_files({p: scripts[e] for e, p in rl.LINK_SCRIPTS})
|
||||
tree = rocknix_tree({p: scripts[e] for e, p in rl.LINK_SCRIPTS})
|
||||
with self.assertRaises(LauncherPatternMissing):
|
||||
rl.links(tree)
|
||||
|
||||
@@ -603,7 +635,7 @@ class ProgramsRunOutsideTheBiosFolder(unittest.TestCase):
|
||||
PATH = f"{SA}/pico-8/scripts/start_pico8.sh"
|
||||
|
||||
def test_pico8_runs_its_binary_from_roms(self):
|
||||
(record,) = [r.entry() for r in rl.pico8(RepoTree.from_files({self.PATH: START_PICO8}))]
|
||||
(record,) = [r.entry() for r in rl.pico8(rocknix_tree({self.PATH: START_PICO8}))]
|
||||
self.assertEqual(
|
||||
(record["emulator"], record["kind"], record["names"], record["search_dir"],
|
||||
record["passes_to"]),
|
||||
@@ -615,7 +647,7 @@ class ProgramsRunOutsideTheBiosFolder(unittest.TestCase):
|
||||
def test_a_script_without_its_binary_choice_raises(self):
|
||||
broken = START_PICO8.replace('STATIC_BIN="pico8_dyn"', "STATIC_BIN=$OTHER")
|
||||
with self.assertRaises(LauncherPatternMissing):
|
||||
rl.pico8(RepoTree.from_files({self.PATH: broken}))
|
||||
rl.pico8(rocknix_tree({self.PATH: broken}))
|
||||
|
||||
|
||||
class Revision(unittest.TestCase):
|
||||
|
||||
Reference in new issue
Block a user