Skip to content
Open
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
18 changes: 18 additions & 0 deletions xayagametest/testcase.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
from . import premine
from . import xaya

import tempfile
import sysconfig
import argparse
from contextlib import contextmanager
import json
Expand Down Expand Up @@ -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)

Expand All @@ -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)

Expand Down