Patchwork [3/4] oeqa/oetest.py: enable sdk tests to use hasFeature and hasPackage methods.

login
register
mail settings
Submitter Corneliu Stoicescu
Date Aug. 26, 2014, 10:05 a.m.
Message ID <1409047544-7026-4-git-send-email-corneliux.stoicescu@intel.com>
Download mbox | patch
Permalink /patch/78959/
State Accepted
Commit e2b4dde94c05ac3d11e1f25c1bb12affd58c1643
Headers show

Comments

Corneliu Stoicescu - Aug. 26, 2014, 10:05 a.m.
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>
---
 meta/lib/oeqa/oetest.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/meta/lib/oeqa/oetest.py b/meta/lib/oeqa/oetest.py
index 5552c43..ed8b3b2 100644
--- a/meta/lib/oeqa/oetest.py
+++ b/meta/lib/oeqa/oetest.py
@@ -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)