summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/sdk/testsdk.py
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oeqa/sdk/testsdk.py')
-rw-r--r--meta/lib/oeqa/sdk/testsdk.py25
1 files changed, 24 insertions, 1 deletions
diff --git a/meta/lib/oeqa/sdk/testsdk.py b/meta/lib/oeqa/sdk/testsdk.py
index 518b09febb..cffcf9f49a 100644
--- a/meta/lib/oeqa/sdk/testsdk.py
+++ b/meta/lib/oeqa/sdk/testsdk.py
@@ -31,6 +31,28 @@ class TestSDK(TestSDKBase):
31 context_class = OESDKTestContext 31 context_class = OESDKTestContext
32 test_type = 'sdk' 32 test_type = 'sdk'
33 33
34 def sdk_dir_names(self, d):
35 """Return list from TESTSDK_CASE_DIRS."""
36 testdirs = d.getVar("TESTSDK_CASE_DIRS")
37 if testdirs:
38 return testdirs.split()
39
40 bb.fatal("TESTSDK_CASE_DIRS unset, can't find SDK test directories.")
41
42 def get_sdk_paths(self, d):
43 """
44 Return a list of paths where SDK test cases reside.
45
46 SDK tests are expected in <LAYER_DIR>/lib/oeqa/<dirname>/cases
47 """
48 paths = []
49 for layer in d.getVar("BBLAYERS").split():
50 for dirname in self.sdk_dir_names(d):
51 case_path = os.path.join(layer, "lib", "oeqa", dirname, "cases")
52 if os.path.isdir(case_path):
53 paths.append(case_path)
54 return paths
55
34 def get_tcname(self, d): 56 def get_tcname(self, d):
35 """ 57 """
36 Get the name of the SDK file 58 Get the name of the SDK file
@@ -114,7 +136,8 @@ class TestSDK(TestSDKBase):
114 host_pkg_manifest=host_pkg_manifest, **context_args) 136 host_pkg_manifest=host_pkg_manifest, **context_args)
115 137
116 try: 138 try:
117 tc.loadTests(self.context_executor_class.default_cases) 139 modules = (d.getVar("TESTSDK_SUITES") or "").split()
140 tc.loadTests(self.get_sdk_paths(d), modules)
118 except Exception as e: 141 except Exception as e:
119 import traceback 142 import traceback
120 bb.fatal("Loading tests failed:\n%s" % traceback.format_exc()) 143 bb.fatal("Loading tests failed:\n%s" % traceback.format_exc())