From c9fe59d7c5e815fb6453f50d0f15699ea6799129 Mon Sep 17 00:00:00 2001 From: Aníbal Limón Date: Sun, 27 Nov 2016 17:51:53 -0600 Subject: oeqa/sdk/cases: Migrate tests to the new OEQA framework MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Mariano Lopez Signed-off-by: Richard Purdie --- meta/lib/oeqa/sdk/cases/buildgalculator.py | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) (limited to 'meta/lib/oeqa/sdk/cases/buildgalculator.py') 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 @@ -from oeqa.oetest import oeSDKTest, skipModule -from oeqa.utils.decorators import * -from oeqa.utils.targetbuild import SDKBuildProject +import unittest -def setUpModule(): - if not (oeSDKTest.hasPackage("gtk+3") or oeSDKTest.hasPackage("libgtk-3.0")): - skipModule("Image doesn't have gtk+3 in manifest") +from oeqa.sdk.case import OESDKTestCase +from oeqa.sdk.utils.sdkbuildproject import SDKBuildProject + +class GalculatorTest(OESDKTestCase): + td_vars = ['TEST_LOG_DIR', 'DATETIME'] + + @classmethod + def setUpClass(self): + if not (self.tc.hasTargetPackage("gtk+3") or\ + self.tc.hasTargetPackage("libgtk-3.0")): + raise unittest.SkipTest("%s class: SDK don't support gtk+3" % self.__name__) -class GalculatorTest(oeSDKTest): def test_galculator(self): + dl_dir = self.td.get('DL_DIR', None) + project = None try: - project = SDKBuildProject(oeSDKTest.tc.sdktestdir + "/galculator/", - oeSDKTest.tc.sdkenv, oeSDKTest.tc.d, - "http://galculator.mnim.org/downloads/galculator-2.1.4.tar.bz2") + project = SDKBuildProject(self.tc.sdk_dir + "/galculator/", + self.tc.sdk_env, + "http://galculator.mnim.org/downloads/galculator-2.1.4.tar.bz2", + self.td['TEST_LOG_DIR'], self.td['DATETIME'], dl_dir=dl_dir) project.download_archive() -- cgit v1.2.3-54-g00ecf