diff options
-rw-r--r-- | meta/lib/oeqa/sdk/cases/buildgalculator.py | 4 | ||||
-rw-r--r-- | meta/lib/oeqa/sdk/cases/buildlzip.py | 4 | ||||
-rw-r--r-- | meta/lib/oeqa/sdk/cases/gcc.py | 4 | ||||
-rw-r--r-- | meta/lib/oeqa/sdk/context.py | 21 |
4 files changed, 20 insertions, 13 deletions
diff --git a/meta/lib/oeqa/sdk/cases/buildgalculator.py b/meta/lib/oeqa/sdk/cases/buildgalculator.py index 3714825b06..050d1b3b52 100644 --- a/meta/lib/oeqa/sdk/cases/buildgalculator.py +++ b/meta/lib/oeqa/sdk/cases/buildgalculator.py | |||
@@ -8,8 +8,8 @@ class GalculatorTest(OESDKTestCase): | |||
8 | 8 | ||
9 | @classmethod | 9 | @classmethod |
10 | def setUpClass(self): | 10 | def setUpClass(self): |
11 | if not (self.tc.hasTargetPackage(r"gtk\+3", multilib=True) or\ | 11 | if not (self.tc.hasTargetPackage("gtk+3", multilib=True) or \ |
12 | self.tc.hasTargetPackage(r"libgtk-3.0", multilib=True)): | 12 | self.tc.hasTargetPackage("libgtk-3.0", multilib=True)): |
13 | raise unittest.SkipTest("GalculatorTest class: SDK don't support gtk+3") | 13 | raise unittest.SkipTest("GalculatorTest class: SDK don't support gtk+3") |
14 | if not (self.tc.hasHostPackage("nativesdk-gettext-dev")): | 14 | if not (self.tc.hasHostPackage("nativesdk-gettext-dev")): |
15 | raise unittest.SkipTest("GalculatorTest class: SDK doesn't contain gettext") | 15 | raise unittest.SkipTest("GalculatorTest class: SDK doesn't contain gettext") |
diff --git a/meta/lib/oeqa/sdk/cases/buildlzip.py b/meta/lib/oeqa/sdk/cases/buildlzip.py index 3a89ce8627..b28cc3a595 100644 --- a/meta/lib/oeqa/sdk/cases/buildlzip.py +++ b/meta/lib/oeqa/sdk/cases/buildlzip.py | |||
@@ -17,8 +17,8 @@ class BuildLzipTest(OESDKTestCase): | |||
17 | 17 | ||
18 | machine = self.td.get("MACHINE") | 18 | machine = self.td.get("MACHINE") |
19 | 19 | ||
20 | if not (self.tc.hasTargetPackage("packagegroup-cross-canadian-%s" % machine) or | 20 | if not (self.tc.hasHostPackage("packagegroup-cross-canadian-%s" % machine) or |
21 | self.tc.hasTargetPackage("gcc")): | 21 | self.tc.hasHostPackage("^gcc-", regex=True)): |
22 | raise unittest.SkipTest("SDK doesn't contain a cross-canadian toolchain") | 22 | raise unittest.SkipTest("SDK doesn't contain a cross-canadian toolchain") |
23 | 23 | ||
24 | def test_lzip(self): | 24 | def test_lzip(self): |
diff --git a/meta/lib/oeqa/sdk/cases/gcc.py b/meta/lib/oeqa/sdk/cases/gcc.py index d11f4b63fb..b32b01fc24 100644 --- a/meta/lib/oeqa/sdk/cases/gcc.py +++ b/meta/lib/oeqa/sdk/cases/gcc.py | |||
@@ -18,8 +18,8 @@ class GccCompileTest(OESDKTestCase): | |||
18 | 18 | ||
19 | def setUp(self): | 19 | def setUp(self): |
20 | machine = self.td.get("MACHINE") | 20 | machine = self.td.get("MACHINE") |
21 | if not (self.tc.hasTargetPackage("packagegroup-cross-canadian-%s" % machine) or | 21 | if not (self.tc.hasHostPackage("packagegroup-cross-canadian-%s" % machine) or |
22 | self.tc.hasTargetPackage("gcc")): | 22 | self.tc.hasHostPackage("^gcc-", regex=True)): |
23 | raise unittest.SkipTest("GccCompileTest class: SDK doesn't contain a cross-canadian toolchain") | 23 | raise unittest.SkipTest("GccCompileTest class: SDK doesn't contain a cross-canadian toolchain") |
24 | 24 | ||
25 | def test_gcc_compile(self): | 25 | def test_gcc_compile(self): |
diff --git a/meta/lib/oeqa/sdk/context.py b/meta/lib/oeqa/sdk/context.py index ec8972d05a..adc4166fd2 100644 --- a/meta/lib/oeqa/sdk/context.py +++ b/meta/lib/oeqa/sdk/context.py | |||
@@ -20,23 +20,30 @@ class OESDKTestContext(OETestContext): | |||
20 | self.target_pkg_manifest = target_pkg_manifest | 20 | self.target_pkg_manifest = target_pkg_manifest |
21 | self.host_pkg_manifest = host_pkg_manifest | 21 | self.host_pkg_manifest = host_pkg_manifest |
22 | 22 | ||
23 | def _hasPackage(self, manifest, pkg): | 23 | def _hasPackage(self, manifest, pkg, regex=False): |
24 | for host_pkg in manifest.keys(): | 24 | if regex: |
25 | if re.search(pkg, host_pkg): | 25 | # do regex match |
26 | pat = re.compile(pkg) | ||
27 | for p in manifest.keys(): | ||
28 | if pat.search(p): | ||
29 | return True | ||
30 | else: | ||
31 | # do exact match | ||
32 | if pkg in manifest.keys(): | ||
26 | return True | 33 | return True |
27 | return False | 34 | return False |
28 | 35 | ||
29 | def hasHostPackage(self, pkg): | 36 | def hasHostPackage(self, pkg, regex=False): |
30 | return self._hasPackage(self.host_pkg_manifest, pkg) | 37 | return self._hasPackage(self.host_pkg_manifest, pkg, regex=regex) |
31 | 38 | ||
32 | def hasTargetPackage(self, pkg, multilib=False): | 39 | def hasTargetPackage(self, pkg, multilib=False, regex=False): |
33 | if multilib: | 40 | if multilib: |
34 | # match multilib according to sdk_env | 41 | # match multilib according to sdk_env |
35 | mls = self.td.get('MULTILIB_VARIANTS', '').split() | 42 | mls = self.td.get('MULTILIB_VARIANTS', '').split() |
36 | for ml in mls: | 43 | for ml in mls: |
37 | if ('ml'+ml) in self.sdk_env: | 44 | if ('ml'+ml) in self.sdk_env: |
38 | pkg = ml + '-' + pkg | 45 | pkg = ml + '-' + pkg |
39 | return self._hasPackage(self.target_pkg_manifest, pkg) | 46 | return self._hasPackage(self.target_pkg_manifest, pkg, regex=regex) |
40 | 47 | ||
41 | class OESDKTestContextExecutor(OETestContextExecutor): | 48 | class OESDKTestContextExecutor(OETestContextExecutor): |
42 | _context_class = OESDKTestContext | 49 | _context_class = OESDKTestContext |