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:03:54 +0000 |
commit | 91cd1ed19a3f34c29cd77eb136036975fe465444 (patch) | |
tree | 1e1e16dbe19b252d2aa8f576e6d1f44d3106fddc /meta/lib/oeqa/sdk/cases/perl.py | |
parent | 581c34d1efe9839f50ef322761269b4e4d8a56a6 (diff) | |
download | openembedded-core-91cd1ed19a3f34c29cd77eb136036975fe465444.tar.gz openembedded-core-91cd1ed19a3f34c29cd77eb136036975fe465444.tar.bz2 openembedded-core-91cd1ed19a3f34c29cd77eb136036975fe465444.zip |
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]
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
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 @@ -import unittest import os import shutil -from oeqa.oetest import oeSDKTest, skipModule -from oeqa.utils.decorators import * - -def setUpModule(): - if not oeSDKTest.hasHostPackage("nativesdk-perl"): - skipModule("No perl package in the SDK") - +import unittest -class PerlTest(oeSDKTest): +from oeqa.core.utils.path import remove_safe +from oeqa.sdk.case import OESDKTestCase +class PerlTest(OESDKTestCase): @classmethod def setUpClass(self): + if not self.tc.hasHostPackage("nativesdk-perl"): + raise unittest.SkipTest("No perl package in the SDK") + for f in ['test.pl']: - shutil.copyfile(os.path.join(self.tc.filesdir, f), self.tc.sdktestdir + f) - self.testfile = self.tc.sdktestdir + "test.pl" + shutil.copyfile(os.path.join(self.tc.files_dir, f), + os.path.join(self.tc.sdk_dir, f)) + self.testfile = os.path.join(self.tc.sdk_dir, "test.pl") def test_perl_exists(self): self._run('which perl') def test_perl_works(self): - self._run('perl %s/test.pl' % self.tc.sdktestdir) + self._run('perl %s' % self.testfile) @classmethod def tearDownClass(self): - bb.utils.remove("%s/test.pl" % self.tc.sdktestdir) + remove_safe(self.testfile) |