diff options
author | Aníbal Limón <anibal.limon@linux.intel.com> | 2016-11-27 17:51:53 -0600 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-01-23 12:05:19 +0000 |
commit | c9fe59d7c5e815fb6453f50d0f15699ea6799129 (patch) | |
tree | 4e7715c04b705eb78f49e55d421b25483c594f9c /meta/lib/oeqa/sdk/cases/buildgalculator.py | |
parent | 51be1880631435627e8ff490d71b024c2683244a (diff) | |
download | poky-c9fe59d7c5e815fb6453f50d0f15699ea6799129.tar.gz |
oeqa/sdk/cases: Migrate tests to the new OEQA framework
Summary of the changes:
- Remove auto extend_path using pkgutil at __init__, is not needed.
- Change base class to OESDKTestCase.
- Add td_vars attr to set dependencies of certain variables in test
data.
- Change skips from module level to class level because Test context
(tc)
now isn't at module level.
- Variable names changes to be consistent (i.e. sdktestdir ->
sdk_dir).
[YOCTO #10599]
- Don't use bb.utils functions use instead remove_safe and shutil
for copy files.
- SDKBuildProject pass test data variables instead of call getVar
inside.
[YOCTO #10231]
(From OE-Core rev: 91cd1ed19a3f34c29cd77eb136036975fe465444)
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/sdk/cases/buildgalculator.py')
-rw-r--r-- | meta/lib/oeqa/sdk/cases/buildgalculator.py | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/meta/lib/oeqa/sdk/cases/buildgalculator.py b/meta/lib/oeqa/sdk/cases/buildgalculator.py index dc2fa9ce19..d2c1189ce6 100644 --- a/meta/lib/oeqa/sdk/cases/buildgalculator.py +++ b/meta/lib/oeqa/sdk/cases/buildgalculator.py | |||
@@ -1,17 +1,25 @@ | |||
1 | from oeqa.oetest import oeSDKTest, skipModule | 1 | import unittest |
2 | from oeqa.utils.decorators import * | ||
3 | from oeqa.utils.targetbuild import SDKBuildProject | ||
4 | 2 | ||
5 | def setUpModule(): | 3 | from oeqa.sdk.case import OESDKTestCase |
6 | if not (oeSDKTest.hasPackage("gtk+3") or oeSDKTest.hasPackage("libgtk-3.0")): | 4 | from oeqa.sdk.utils.sdkbuildproject import SDKBuildProject |
7 | skipModule("Image doesn't have gtk+3 in manifest") | 5 | |
6 | class GalculatorTest(OESDKTestCase): | ||
7 | td_vars = ['TEST_LOG_DIR', 'DATETIME'] | ||
8 | |||
9 | @classmethod | ||
10 | def setUpClass(self): | ||
11 | if not (self.tc.hasTargetPackage("gtk+3") or\ | ||
12 | self.tc.hasTargetPackage("libgtk-3.0")): | ||
13 | raise unittest.SkipTest("%s class: SDK don't support gtk+3" % self.__name__) | ||
8 | 14 | ||
9 | class GalculatorTest(oeSDKTest): | ||
10 | def test_galculator(self): | 15 | def test_galculator(self): |
16 | dl_dir = self.td.get('DL_DIR', None) | ||
17 | project = None | ||
11 | try: | 18 | try: |
12 | project = SDKBuildProject(oeSDKTest.tc.sdktestdir + "/galculator/", | 19 | project = SDKBuildProject(self.tc.sdk_dir + "/galculator/", |
13 | oeSDKTest.tc.sdkenv, oeSDKTest.tc.d, | 20 | self.tc.sdk_env, |
14 | "http://galculator.mnim.org/downloads/galculator-2.1.4.tar.bz2") | 21 | "http://galculator.mnim.org/downloads/galculator-2.1.4.tar.bz2", |
22 | self.td['TEST_LOG_DIR'], self.td['DATETIME'], dl_dir=dl_dir) | ||
15 | 23 | ||
16 | project.download_archive() | 24 | project.download_archive() |
17 | 25 | ||