diff --git a/xayagametest/testcase.py b/xayagametest/testcase.py index 0fc82009..52e100a6 100644 --- a/xayagametest/testcase.py +++ b/xayagametest/testcase.py @@ -10,6 +10,8 @@ from . import premine from . import xaya +import tempfile +import sysconfig import argparse from contextlib import contextmanager import json @@ -101,6 +103,14 @@ def main (self): randomSuffix = "%08x" % random.getrandbits (32) self.basedir = os.path.join (self.args.dir, DIR_PREFIX + randomSuffix) + + if sysconfig.get_platform() == "mingw_x86_64": + self.args.dir = tempfile.gettempdir() + self.basedir = os.path.join (self.args.dir, DIR_PREFIX + randomSuffix) + spath = sys.path[0] + spath = spath.replace("\\","/") + self.args.game_daemon = spath + "/../src/" + self.gameId + "d.exe" + shutil.rmtree (self.basedir, ignore_errors=True) os.mkdir (self.basedir) @@ -121,6 +131,14 @@ def main (self): self.mainLogger = logging.getLogger ("main") self.mainLogger.addHandler (logHandler) self.mainLogger.addHandler (mainHandler) + + if sysconfig.get_platform() == "mingw_x86_64": + self.mainLogger.info ("msys2 mingw windows build detected, adjustings paths") + self.mainLogger.info ("setting new tempdir as %s" % tempfile.gettempdir()) + self.args.xayad_binary = sysconfig.get_config_var('LIBDIR') + "/daemon/xayad" + self.mainLogger.info ("setting new bynary path as %s" % self.args.xayad_binary) + self.mainLogger.info ("setting new game_daemon path as %s" % self.args.game_daemon) + self.mainLogger.info ("Base directory for integration test: %s" % self.basedir)