Skip to content

armgit / soju

Public Imported from GitHub
0

Play Windows games on Apple Silicon Macs. Free, open-source app that installs the official Battle.net, Steam, Epic and GOG launchers and lists your games in one library.

Play stats: the Rockstar launcher is told apart from Battle.net's; Steam support build fetches its pinned DXMT commit; the game page test reads every page (#216)

Mikek0a91b1dfecf5
diff --git a/scripts/build-steam-support.sh b/scripts/build-steam-support.sh
index 907a99e6e0b..0aa4c817363 100755
--- a/scripts/build-steam-support.sh
+++ b/scripts/build-steam-support.sh
@@ -27,6 +27,8 @@ clone(){
}
clone https://github.com/notpop/dxmt.git dxmt debug/present-path-tracing
if [ "${SOJU_SOURCE_ARCHIVE:-0}" != 1 ]; then
+ # The pinned commit by name: the shallow clone only has the branch tip, which moves when the fork is pushed to.
+ git -C dxmt cat-file -e 924a607e3eee06fad5be6f176d8510bb08bc418d 2>/dev/null || git -C dxmt fetch -q --depth 1 origin 924a607e3eee06fad5be6f176d8510bb08bc418d
git -C dxmt checkout --detach 924a607e3eee06fad5be6f176d8510bb08bc418d
git -C dxmt submodule update --init --recursive
fi
diff --git a/scripts/play-stats.py b/scripts/play-stats.py
index 2978cbb8090..1afefd9c681 100755
--- a/scripts/play-stats.py
+++ b/scripts/play-stats.py
@@ -231,7 +231,7 @@ def why(text, found=()):
LAUNCHER_EXE = {"battlenet": "battle.net.exe", "steam": "\\steam.exe", "epic": "epicgameslauncher.exe", "gog": "galaxyclient.exe",
- "ea": "eadesktop.exe", "rockstar": "launcher.exe", "ubisoft": "upc.exe"}
+ "ea": "eadesktop.exe", "rockstar": "\\launcher.exe", "ubisoft": "upc.exe"}
def launcher_state(launcher, table=None):
diff --git a/tests/test_mac_games.py b/tests/test_mac_games.py
index 70e51568758..78cc34a8d19 100644
--- a/tests/test_mac_games.py
+++ b/tests/test_mac_games.py
@@ -39,12 +39,12 @@ class MacGamePages(unittest.TestCase):
# Pages with only a Linux-based estimate are noindex and absent from the sitemap;
# checked pages and pages with Mac reports are indexable and listed.
import re
- sitemap = (ROOT / "docs/sitemap.xml").read_text()
+ sitemap = set(re.findall(r"<loc>https://didimlabs\.com/mac/([^<]+)</loc>", (ROOT / "docs/sitemap.xml").read_text()))
hidden = listed = 0
- for page in sorted((ROOT / "docs/mac").glob("*.html"))[:4000]:
+ for page in sorted((ROOT / "docs/mac").glob("*.html")): # every page, not the first few thousand
text = page.read_text()
noindex = '<meta name="robots" content="noindex,follow">' in text
- in_sitemap = ("https://didimlabs.com/mac/%s</loc>" % page.name) in sitemap
+ in_sitemap = page.name in sitemap
if page.name == "index.html":
continue
self.assertNotEqual(noindex, in_sitemap, page.name)
diff --git a/tests/test_play_stats.py b/tests/test_play_stats.py
index f678a3bd8b1..eb491b22d66 100644
--- a/tests/test_play_stats.py
+++ b/tests/test_play_stats.py
@@ -204,6 +204,9 @@ class PlayStats(unittest.TestCase):
self.assertEqual(ps.launcher_state('battlenet', 'c:\\program files (x86)\\battle.net\\battle.net.exe --exec=launch osi'), 'launcher_open')
self.assertEqual(ps.launcher_state('battlenet', 'something else'), 'launcher_closed')
self.assertEqual(ps.launcher_state('didim', 'anything'), '')
+ # Battle.net's own 'Battle.net Launcher.exe' is not the Rockstar Games Launcher.
+ self.assertEqual(ps.launcher_state('rockstar', 'c:\\program files (x86)\\battle.net\\battle.net launcher.exe --exec'), 'launcher_closed')
+ self.assertEqual(ps.launcher_state('rockstar', 'c:\\program files\\rockstar games\\launcher\\launcher.exe'), 'launcher_open')
def test_watch_stops_when_steam_is_gone(self):
clock = Clock()