]> code.ossystems Code Review - openembedded-core.git/commitdiff
testsdkext: Add skeleton for support Extensible SDK tests.
authorAníbal Limón <limon.anibal@gmail.com>
Sun, 31 Jan 2016 14:45:47 +0000 (08:45 -0600)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 10 Feb 2016 15:51:03 +0000 (15:51 +0000)
oeqa/sdkext: Add module and __init__.py will contain eSDK tests.
classes/testsdk: Add support for run eSDK tests.
oeqa/oetest: Create oeSDKExtTest for now only inherit oeSDKTest,
             modified SDKExtTestContext now inherit SDKTestContext
             and set sdkext filesdir for store data fixtures.

Signed-off-by: Aníbal Limón <limon.anibal@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/classes/testsdk.bbclass
meta/lib/oeqa/oetest.py
meta/lib/oeqa/sdkext/__init__.py [new file with mode: 0644]

index a0c50fe4a9e7abdc3efc100ef0554d222ddd530a..417510ce3d5bf054ffd609204b1acb5275465cb3 100644 (file)
@@ -114,7 +114,15 @@ def testsdkext_main(d):
         bb.plain("Running SDK Compatibility tests ...")
         run_test_context(SDKTestContext, d, testdir, tcname, pn)
     finally:
-        bb.utils.remove(testdir, True)
+        pass
+
+    try:
+        bb.plain("Running Extensible SDK tests ...")
+        run_test_context(SDKExtTestContext, d, testdir, tcname, pn)
+    finally:
+        pass
+
+    bb.utils.remove(testdir, True)
 
 testsdkext_main[vardepsexclude] =+ "BB_ORIGENV"
 
index 47ea3b259f419da5c5e1d4487483d64990b0269e..620617c4fb77fb312dab7497bcfbd7876e5ae0e4 100644 (file)
@@ -19,6 +19,7 @@ except ImportError:
 import logging
 
 import oeqa.runtime
+import oeqa.sdkext
 from oeqa.utils.decorators import LogResults, gettag, getResults
 
 logger = logging.getLogger("BitBake")
@@ -126,6 +127,9 @@ class oeSDKTest(oeTest):
     def _run(self, cmd):
         return subprocess.check_output(". %s > /dev/null; %s;" % (self.tc.sdkenv, cmd), shell=True)
 
+class oeSDKExtTest(oeSDKTest):
+    pass
+
 def getmodule(pos=2):
     # stack returns a list of tuples containg frame information
     # First element of the list the is current frame, caller is 1
@@ -400,7 +404,13 @@ class SDKTestContext(TestContext):
         return [t for t in (self.d.getVar("TEST_SUITES_SDK", True) or \
                 "auto").split() if t != "auto"]
 
-class SDKExtTestContext(TestContext):
+class SDKExtTestContext(SDKTestContext):
+    def __init__(self, d, sdktestdir, sdkenv):
+        super(SDKExtTestContext, self).__init__(d, sdktestdir, sdkenv)
+
+        self.sdkextfilesdir = os.path.join(os.path.dirname(os.path.abspath(
+            oeqa.sdkext.__file__)), "files")
+
     def _get_test_namespace(self):
         return "sdkext"
 
diff --git a/meta/lib/oeqa/sdkext/__init__.py b/meta/lib/oeqa/sdkext/__init__.py
new file mode 100644 (file)
index 0000000..4cf3fa7
--- /dev/null
@@ -0,0 +1,3 @@
+# Enable other layers to have tests in the same named directory
+from pkgutil import extend_path
+__path__ = extend_path(__path__, __name__)