mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-22 14:26:00 +00:00
fix(fex): x86 programs use DroidDeck's own FEX build, kept to the catalog's version
This commit is contained in:
1 parent
5bdf0d6b04
commit
7e2d13b641
10 files changed
+142
-82
No files matched your search
@@ -48,6 +48,8 @@ class FexTestCase(unittest.TestCase):
|
||||
"HOST_PRELOAD": str(self.tmp / "ld.so.preload"),
|
||||
"DEVICE_FONTS": str(self.tmp / "android-fonts"),
|
||||
"FONT_RULES": str(self.tmp / "66-droiddeck-device-fonts.conf"),
|
||||
"OWN_FEX": str(self.tmp / "own"),
|
||||
"OWN_FEX_TAG": str(self.tmp / "own/share/fex-emu/.droiddeck-tag"),
|
||||
}
|
||||
patcher = mock.patch.dict(G, patches)
|
||||
patcher.start()
|
||||
@@ -202,6 +204,37 @@ class LocateTest(FexTestCase):
|
||||
self.assertEqual((fex["bin"], fex["server"], fex["portable"]), (str(tool / "usr/bin/FEX"), str(tool / "usr/bin/FEXServer"), True))
|
||||
self.assertTrue(fex["host_thunks"].endswith("HostThunks") and fex["guest_thunks"].endswith("GuestThunks") and fex["thunks_db"])
|
||||
|
||||
def own_fex(self, tag):
|
||||
own = self.tmp / "own"
|
||||
self.write(own / "bin/FEX", mode=0o755)
|
||||
self.write(own / "bin/FEXServer", mode=0o755)
|
||||
self.write(own / "share/fex-emu/.droiddeck-tag", tag + "\n")
|
||||
return own
|
||||
|
||||
def test_droiddeck_s_own_build_comes_before_the_steam_tool(self):
|
||||
self.fex_tool(self.steam)
|
||||
own = self.own_fex("fex-2610-r7")
|
||||
fex = FEX["fex_install"]()
|
||||
self.assertEqual((fex["bin"], fex["server"], fex["portable"]), (str(own / "bin/FEX"), str(own / "bin/FEXServer"), False))
|
||||
|
||||
def test_the_build_the_session_names_is_installed_once(self):
|
||||
self.own_fex("fex-2610-r6")
|
||||
calls = []
|
||||
with mock.patch.dict(os.environ, {"BL_FEX_TAG": "fex-2610-r7"}), \
|
||||
mock.patch.object(G["subprocess"], "call", lambda args, **kw: calls.append(args) or 0):
|
||||
FEX["update_own_fex"]()
|
||||
self.write(self.tmp / "own/share/fex-emu/.droiddeck-tag", "fex-2610-r7\n")
|
||||
FEX["update_own_fex"]()
|
||||
self.assertEqual([[str(BIN / "droiddeck-fex-update")]], calls)
|
||||
|
||||
def test_no_build_is_installed_without_one_from_the_session(self):
|
||||
calls = []
|
||||
with mock.patch.dict(os.environ, {}, clear=False), \
|
||||
mock.patch.object(G["subprocess"], "call", lambda args, **kw: calls.append(args) or 0):
|
||||
os.environ.pop("BL_FEX_TAG", None)
|
||||
FEX["update_own_fex"]()
|
||||
self.assertEqual([], calls)
|
||||
|
||||
def test_library_folders_are_read(self):
|
||||
other = self.tmp / "other"
|
||||
(other / "steamapps/common").mkdir(parents=True)
|
||||
|
||||
@@ -6,7 +6,7 @@ import tempfile
|
||||
import textwrap
|
||||
import unittest
|
||||
|
||||
SCRIPT = Path(__file__).resolve().parents[1] / "linuxfs/overlay/usr/local/bin/droiddeck-steam-x64"
|
||||
SCRIPT = Path(__file__).resolve().parents[1] / "linuxfs/overlay/usr/local/bin/droiddeck-fex-update"
|
||||
SOURCE = SCRIPT.read_text()
|
||||
START = SOURCE.index("fex_install() {")
|
||||
END = SOURCE.index("\n}\n", START) + 3
|
||||
|
||||
@@ -5,9 +5,9 @@ import tempfile
|
||||
import textwrap
|
||||
import unittest
|
||||
|
||||
SCRIPT = Path(__file__).resolve().parents[1] / "linuxfs/overlay/usr/local/bin/droiddeck-steam-x64"
|
||||
SCRIPT = Path(__file__).resolve().parents[1] / "linuxfs/overlay/usr/local/bin/droiddeck-fex-update"
|
||||
SOURCE = SCRIPT.read_text()
|
||||
START = SOURCE.index("x64_fex() {")
|
||||
START = SOURCE.index("fex_ready() {")
|
||||
END = SOURCE.index("\n}\n", START) + 3
|
||||
X64_FEX = SOURCE[START:END]
|
||||
|
||||
@@ -35,7 +35,7 @@ class FexSelectTest(unittest.TestCase):
|
||||
fex.chmod(0o755)
|
||||
body = (X64_FEX.replace("/usr/local/share/fex-emu/.droiddeck-tag", "$ROOT/tag")
|
||||
.replace("/usr/local/bin/FEX", "$ROOT/FEX"))
|
||||
script = HARNESS + body + 'if x64_fex; then echo "NOW $FEX_NOW|$FEX_FROM"; else echo FAILED; fi\n'
|
||||
script = HARNESS + body + 'if fex_ready; then echo "NOW $FEX_NOW|$FEX_FROM"; else echo FAILED; fi\n'
|
||||
env = dict(os.environ, ROOT=root, LOADS="1" if loads else "0", INSTALLABLE=" ".join(installable))
|
||||
env.pop("BL_FEX_TAG", None)
|
||||
if catalog:
|
||||
|
||||
Reference in new issue
Block a user