diff options
Diffstat (limited to 'lib/oeqa/sdkmingw/testsdk.py')
-rw-r--r-- | lib/oeqa/sdkmingw/testsdk.py | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/lib/oeqa/sdkmingw/testsdk.py b/lib/oeqa/sdkmingw/testsdk.py new file mode 100644 index 0000000..85fe3c6 --- /dev/null +++ b/lib/oeqa/sdkmingw/testsdk.py | |||
@@ -0,0 +1,42 @@ | |||
1 | # Copyright 2018 by Garmin Ltd. or its subsidiaries | ||
2 | # Released under the MIT license (see COPYING.MIT) | ||
3 | |||
4 | from oeqa.sdk.testsdk import TestSDK | ||
5 | from oeqa.sdkmingw.context import OESDKMinGWTestContext, OESDKMinGWTestContextExecutor | ||
6 | |||
7 | class TestSDKMinGW(TestSDK): | ||
8 | context_executor_class = OESDKMinGWTestContextExecutor | ||
9 | context_class = OESDKMinGWTestContext | ||
10 | |||
11 | def get_tcname(self, d): | ||
12 | """ | ||
13 | Get the name of the SDK file | ||
14 | """ | ||
15 | return d.expand("${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.tar.xz") | ||
16 | |||
17 | def extract_sdk(self, tcname, sdk_dir, d): | ||
18 | """ | ||
19 | Extract the SDK to the specified location | ||
20 | """ | ||
21 | import subprocess | ||
22 | |||
23 | try: | ||
24 | # TODO: It would be nice to try and extract the SDK in Wine to make | ||
25 | # sure it is well formed | ||
26 | subprocess.check_output(['tar', '-xf', tcname, '-C', sdk_dir]) | ||
27 | except subprocess.CalledProcessError as e: | ||
28 | bb.fatal("Couldn't install the SDK:\n%s" % e.output.decode("utf-8")) | ||
29 | |||
30 | def setup_context(self, d): | ||
31 | """ | ||
32 | Return a dictionary of additional arguments that should be passed to | ||
33 | the context_class on construction | ||
34 | """ | ||
35 | wine_prefix = d.getVar('TESTSDK_WINEPREFIX') or d.expand('${WORKDIR}/testimage-wine/') | ||
36 | bb.utils.remove(wine_prefix, True) | ||
37 | |||
38 | return { | ||
39 | 'wine_prefix': wine_prefix, | ||
40 | 'wine_arch': d.getVar('TESTSDK_WINEARCH') or 'win64' | ||
41 | } | ||
42 | |||