Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion tests/test_finish_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import stat
import tempfile
import unittest
from types import SimpleNamespace
from unittest import mock

ROOT = Path(__file__).resolve().parents[1]
Expand Down Expand Up @@ -70,7 +71,8 @@ def finish(self, launcher=False):
with mock.patch.object(make_game, "BESIDE", ["hookshot.exe"]):
# Comprehensions use globals. Keep one namespace, as in production, and discover only authored setup files.
namespace = dict(make_game.__dict__, built=str(self.built), out=str(self.out), work=str(self.work),
ROOT=str(self.root / "tools"), LINUX=False if launcher else make_game.LINUX)
ROOT=str(self.root / "tools"), LINUX=False if launcher else make_game.LINUX,
a=SimpleNamespace(fsr=False, no_fsr=False, update=None, fetch_fsr_runtime=False))
exec(FINISH, namespace)

def assert_installed_unchanged(self):
Expand Down
4 changes: 3 additions & 1 deletion tests/test_linux_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import sys
import tempfile
import unittest
from types import SimpleNamespace
import zipfile
from pathlib import Path

Expand Down Expand Up @@ -615,7 +616,8 @@ def test_a_packaged_build_puts_the_launcher_in_the_folder_and_the_game_in_bin(se
for name in make_game.BESIDE: # (a folder from a builder before the launcher: the game and its libraries in it)
(out / name).write_bytes(b"old " + name.encode())
with mock.patch.dict(os.environ, {"HOOKSHOT_TOOLS": str(ROOT)}):
exec(finish, make_game.__dict__, {"built": str(built), "out": str(out), "work": str(work)})
exec(finish, make_game.__dict__, {"built": str(built), "out": str(out), "work": str(work),
"a": SimpleNamespace(fsr=False, no_fsr=False, update=None, fetch_fsr_runtime=False)})
self.assertEqual((out / "hookshot").read_bytes(), (ROOT / "builder" / "linux" / "hookshot-folder").read_bytes())
self.assertTrue((out / "hookshot").stat().st_mode & stat.S_IXUSR)
self.assertEqual(sorted(p.name for p in out.iterdir()), ["bin", "hookshot", "image.bin"])
Expand Down
4 changes: 2 additions & 2 deletions tests/test_vsync_row.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def main():
command = [args.cxx, "/nologo", "/std:c++20", "/EHsc", "/DHOOKSHOT_TEST_WINDOWS=%d" % windows, str(src),
"/Fo" + str(Path(tmp) / "choice.obj"), "/Fe" + str(exe)]
else:
command = [args.cxx, "-std=c++20", "-Wall", "-Wextra", "-Werror", "-DHOOKSHOT_TEST_WINDOWS=%d" % windows,
command = [args.cxx, "-std=c++20", "-Wall", "-Wextra", "-Werror", "-D_CRT_SECURE_NO_WARNINGS", "-DHOOKSHOT_TEST_WINDOWS=%d" % windows,
str(src), "-o", str(exe)]
subprocess.run(command, cwd=tmp, check=True)
subprocess.run([str(exe)], check=True)
Expand All @@ -145,7 +145,7 @@ def main():
command = [args.cxx, "/nologo", "/std:c++20", "/EHsc", "/D_CRT_SECURE_NO_WARNINGS", str(src),
"/Fo" + str(Path(tmp) / "vsync.obj"), "/Fe" + str(exe)]
else:
command = [args.cxx, "-std=c++20", "-Wall", "-Wextra", "-Werror", str(src), "-o", str(exe)]
command = [args.cxx, "-std=c++20", "-Wall", "-Wextra", "-Werror", "-D_CRT_SECURE_NO_WARNINGS", str(src), "-o", str(exe)]
subprocess.run(command, cwd=tmp, check=True)
env = {k: v for k, v in os.environ.items() if k not in ("RX_VK_FIFO", "RX_VK_IMMEDIATE")}
subprocess.run([str(exe)], check=True, env=env)
Expand Down
Loading