summaryrefslogtreecommitdiffstats
path: root/lib/oeqa/sdkmingw/context.py
diff options
context:
space:
mode:
authorJoshua Watt <JPEWhacker@gmail.com>2022-12-08 10:48:19 -0600
committerJoshua Watt <JPEWhacker@gmail.com>2022-12-08 10:49:05 -0600
commitf40731611e9682928db78c83db72d384c2edee10 (patch)
tree457ee5aeeb7a81944e350f8aa3891a3a5d11b110 /lib/oeqa/sdkmingw/context.py
parent4a066511a944ec946efa7a4571029c992cf0ae00 (diff)
downloadmeta-mingw-f40731611e9682928db78c83db72d384c2edee10.tar.gz
tests: Map WORKDIR to W: to shorten paths
In some cases Wine (and Windows proper) struggle with very long paths; in particular the way that gcc invokes the 'cc1' subprogram is limited in how deep the path to the subprogram can be. This can cause issues when testing the SDK under wine, as the paths can easily get quite long and exceed this limit. In order to work around this, setup the Wine test context so that the W: drive maps to the SDK image ${WORKDIR}, which allows wine to effectively use paths relative to this directory making them significantly shorter. Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Diffstat (limited to 'lib/oeqa/sdkmingw/context.py')
-rw-r--r--lib/oeqa/sdkmingw/context.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/oeqa/sdkmingw/context.py b/lib/oeqa/sdkmingw/context.py
index edabcbd..5319223 100644
--- a/lib/oeqa/sdkmingw/context.py
+++ b/lib/oeqa/sdkmingw/context.py
@@ -12,10 +12,19 @@ class OESDKMinGWTestContext(OESDKTestContext):
12 sdk_files_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "files") 12 sdk_files_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "files")
13 13
14 def __init__(self, td=None, logger=None, sdk_dir=None, sdk_env=None, wine_prefix=None, 14 def __init__(self, td=None, logger=None, sdk_dir=None, sdk_env=None, wine_prefix=None,
15 wine_arch=None, target_pkg_manifest=None, host_pkg_manifest=None): 15 wine_arch=None, wine_devices={}, target_pkg_manifest=None, host_pkg_manifest=None):
16 super(OESDKMinGWTestContext, self).__init__(td, logger, sdk_dir, sdk_env, target_pkg_manifest, host_pkg_manifest) 16 super(OESDKMinGWTestContext, self).__init__(td, logger, sdk_dir, sdk_env, target_pkg_manifest, host_pkg_manifest)
17 self.wine_prefix = wine_prefix 17 self.wine_prefix = wine_prefix
18 self.wine_arch = wine_arch 18 self.wine_arch = wine_arch
19 # Create the wine environment
20 subprocess.check_output(["wine", "cmd", "/c", "echo 1"], env=self.get_wine_env())
21
22 device_dir = "%s/dosdevices" % wine_prefix
23 bb.utils.mkdirhier(device_dir)
24 for device, path in wine_devices.items():
25 device_path = "%s/%s" % (device_dir, device)
26 os.symlink(os.path.relpath(path, device_dir), device_path)
27
19 self.wine_sdk_dir = self.wine_path(sdk_dir) 28 self.wine_sdk_dir = self.wine_path(sdk_dir)
20 self.wine_sdk_env = self.wine_path(sdk_env) 29 self.wine_sdk_env = self.wine_path(sdk_env)
21 30