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/perl.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/perl.py')
-rw-r--r-- | meta/lib/oeqa/sdk/cases/perl.py | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/meta/lib/oeqa/sdk/cases/perl.py b/meta/lib/oeqa/sdk/cases/perl.py index 45f422ef0b..e1bded2ff2 100644 --- a/meta/lib/oeqa/sdk/cases/perl.py +++ b/meta/lib/oeqa/sdk/cases/perl.py | |||
@@ -1,28 +1,27 @@ | |||
1 | import unittest | ||
2 | import os | 1 | import os |
3 | import shutil | 2 | import shutil |
4 | from oeqa.oetest import oeSDKTest, skipModule | 3 | import unittest |
5 | from oeqa.utils.decorators import * | ||
6 | |||
7 | def setUpModule(): | ||
8 | if not oeSDKTest.hasHostPackage("nativesdk-perl"): | ||
9 | skipModule("No perl package in the SDK") | ||
10 | |||
11 | 4 | ||
12 | class PerlTest(oeSDKTest): | 5 | from oeqa.core.utils.path import remove_safe |
6 | from oeqa.sdk.case import OESDKTestCase | ||
13 | 7 | ||
8 | class PerlTest(OESDKTestCase): | ||
14 | @classmethod | 9 | @classmethod |
15 | def setUpClass(self): | 10 | def setUpClass(self): |
11 | if not self.tc.hasHostPackage("nativesdk-perl"): | ||
12 | raise unittest.SkipTest("No perl package in the SDK") | ||
13 | |||
16 | for f in ['test.pl']: | 14 | for f in ['test.pl']: |
17 | shutil.copyfile(os.path.join(self.tc.filesdir, f), self.tc.sdktestdir + f) | 15 | shutil.copyfile(os.path.join(self.tc.files_dir, f), |
18 | self.testfile = self.tc.sdktestdir + "test.pl" | 16 | os.path.join(self.tc.sdk_dir, f)) |
17 | self.testfile = os.path.join(self.tc.sdk_dir, "test.pl") | ||
19 | 18 | ||
20 | def test_perl_exists(self): | 19 | def test_perl_exists(self): |
21 | self._run('which perl') | 20 | self._run('which perl') |
22 | 21 | ||
23 | def test_perl_works(self): | 22 | def test_perl_works(self): |
24 | self._run('perl %s/test.pl' % self.tc.sdktestdir) | 23 | self._run('perl %s' % self.testfile) |
25 | 24 | ||
26 | @classmethod | 25 | @classmethod |
27 | def tearDownClass(self): | 26 | def tearDownClass(self): |
28 | bb.utils.remove("%s/test.pl" % self.tc.sdktestdir) | 27 | remove_safe(self.testfile) |