]> code.ossystems Code Review - openembedded-core.git/commitdiff
oeqa/oetest.py: enable sdk tests to use hasFeature and hasPackage methods.
authorCorneliu Stoicescu <corneliux.stoicescu@intel.com>
Tue, 26 Aug 2014 10:05:43 +0000 (13:05 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 27 Aug 2014 11:12:06 +0000 (12:12 +0100)
In order to use the hasFeature and hasPackage methods, we need to make oeSDKTest extend oeTest and also set the test context (tc) attribute in the oeTest class when loading the tests.

Signed-off-by: Corneliu Stoicescu <corneliux.stoicescu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/oetest.py

index 5552c4322ebf52f11c81f26c3887f0147a771a5a..ed8b3b2ffab77e62f6443991a2517db1ca5967aa 100644 (file)
@@ -23,7 +23,7 @@ def loadTests(tc, type="runtime"):
         suite = unittest.TestSuite()
     elif type == "sdk":
         # set the context object passed from the test class
-        setattr(oeSDKTest, "tc", tc)
+        setattr(oeTest, "tc", tc)
     testloader = unittest.TestLoader()
     testloader.sortTestMethodsUsing = None
     suite = testloader.loadTestsFromNames(tc.testslist)
@@ -66,7 +66,7 @@ class oeRuntimeTest(oeTest):
         self.target = oeRuntimeTest.tc.target
         super(oeRuntimeTest, self).__init__(methodName)
 
-class oeSDKTest(unittest.TestCase):
+class oeSDKTest(oeTest):
     def __init__(self, methodName='runTest'):
         self.sdktestdir = oeSDKTest.tc.sdktestdir
         super(oeSDKTest, self).__init__(methodName)