diff --git a/tests/test_config.sh b/tests/test_config.sh index 2b757db06..ef517c0bc 100644 --- a/tests/test_config.sh +++ b/tests/test_config.sh @@ -5,17 +5,19 @@ python --version tmp=$(mktemp) mkdir -p "$HOME/.local/share/Steam/compatibilitytools.d" mkdir -p "$HOME/Games/umu/umu-0" -curl -LJO "https://github.com/Open-Wine-Components/umu-proton/releases/download/UMU-Proton-9.0-3/UMU-Proton-9.0-3.tar.gz" -tar xaf UMU-Proton-9.0-3.tar.gz -mv UMU-Proton-9.0-3 "$HOME/.local/share/Steam/compatibilitytools.d" +curl -LJO "https://github.com/Open-Wine-Components/umu-proton/releases/download/UMU-Proton-9.0-3.2/UMU-Proton-9.0-3.2.tar.gz" +tar xaf UMU-Proton-9.0-3.2.tar.gz +mv UMU-Proton-9.0-3.2 "$HOME/.local/share/Steam/compatibilitytools.d" echo "[umu] -proton = '~/.local/share/Steam/compatibilitytools.d/UMU-Proton-9.0-3' -game_id = 'umu-0' +proton = '~/.local/share/Steam/compatibilitytools.d/UMU-Proton-9.0-3.2' +game_id = 'umu-1141086411' prefix = '~/Games/umu/umu-0' exe = '~/Games/umu/umu-0/drive_c/windows/syswow64/wineboot.exe' launch_args = ['-u'] +store = 'gog' " >> "$tmp" -UMU_LOG=debug GAMEID=umu-0 "$PWD/.venv/bin/python" "$HOME/.local/bin/umu-run" --config "$tmp" +UMU_LOG=debug GAMEID=umu-1141086411 STORE=gog "$PWD/.venv/bin/python" "$HOME/.local/bin/umu-run" --config "$tmp" 2> /tmp/umu-log.txt && grep -E "INFO: Non-steam game Silent Hill 4: The Room \(umu-1141086411\)" /tmp/umu-log.txt +# Run the 'game' using UMU-Proton9.0-3.2 and ensure the protonfixes module finds its fix in umu-database.csv diff --git a/umu/umu_run.py b/umu/umu_run.py index 7e0c4da8b..f730e97b1 100755 --- a/umu/umu_run.py +++ b/umu/umu_run.py @@ -252,12 +252,12 @@ def set_env( env["EXE"] = args[0] # type: ignore env["STEAM_COMPAT_INSTALL_PATH"] = "" log.warning("Executable not found: %s", env["EXE"]) + env["STORE"] = os.environ.get("STORE", "") else: # Configuration file usage exe: Path = Path(env["EXE"]).expanduser() env["EXE"] = str(exe) env["STEAM_COMPAT_INSTALL_PATH"] = str(exe.parent) - - env["STORE"] = os.environ.get("STORE") or "" + env["STORE"] = env.get("STORE", "") # UMU_ID env["UMU_ID"] = env["GAMEID"] diff --git a/umu/umu_test.py b/umu/umu_test.py index a2bec267a..636b662f6 100644 --- a/umu/umu_test.py +++ b/umu/umu_test.py @@ -1917,7 +1917,6 @@ def test_set_env_winetricks(self): os.environ["WINEPREFIX"] = self.test_file os.environ["PROTONPATH"] = test_dir.as_posix() os.environ["GAMEID"] = test_str - os.environ["STORE"] = test_str os.environ["PROTON_VERB"] = proton_verb # Args result = umu_run.parse_args() @@ -1963,9 +1962,6 @@ def test_set_env_winetricks(self): Path(path_exe).parent.as_posix(), "Expected STEAM_COMPAT_INSTALL_PATH to be set", ) - self.assertEqual( - self.env["STORE"], test_str, "Expected STORE to be set" - ) self.assertEqual( self.env["PROTONPATH"], Path(path_exe).parent.parent.as_posix(), diff --git a/umu/umu_test_plugins.py b/umu/umu_test_plugins.py index 1e63020d4..fbf708737 100644 --- a/umu/umu_test_plugins.py +++ b/umu/umu_test_plugins.py @@ -641,6 +641,7 @@ def test_set_env_toml_paths(self): def test_set_env_toml_opts(self): """Test set_env_toml when passed a string as a launch argument.""" test_toml = "foo.toml" + test_store = "gog" toml_str = f""" [umu] prefix = "{self.test_file}" @@ -648,6 +649,7 @@ def test_set_env_toml_opts(self): game_id = "{self.test_file}" launch_args = "{self.test_file} {self.test_file}" exe = "{self.test_exe}" + store = "{test_store}" """ toml_path = self.test_file + "/" + test_toml result = None @@ -708,6 +710,11 @@ def test_set_env_toml_opts(self): self.assertEqual( self.env["GAMEID"], self.test_file, "Expected GAMEID to be set" ) + self.assertEqual( + self.env["STORE"], + "gog", + f"Expected STORE to be '{test_store}'", + ) def test_set_env_toml(self): """Test set_env_toml."""