@@ -19,6 +19,7 @@ TESTSDK_SUITES ?= ""
TESTSDK_CLASS_NAME ?= "oeqa.sdk.testsdk.TestSDK"
TESTSDKEXT_CLASS_NAME ?= "oeqa.sdkext.testsdk.TestSDKExt"
+TESTSDK_CASE_DIRS ?= "sdk"
def import_and_run(name, d):
import importlib
@@ -6,6 +6,13 @@
from oeqa.sdk.context import OESDKTestContext, OESDKTestContextExecutor
+# TODO: drop once the meta-mingw layer migrates to TESTSDK_CASE_DIRS
+def mingw_default_dir(d):
+ sdkmach = d.getVar("SDKMACHINE") or ""
+ if sdkmach.endswith("mingw32"):
+ return "sdkmingw"
+ return ""
+
class TestSDKBase(object):
@staticmethod
def get_sdk_configuration(d, test_type):
@@ -31,6 +38,32 @@ class TestSDK(TestSDKBase):
context_class = OESDKTestContext
test_type = 'sdk'
+ def sdk_dir_names(self, d):
+ """Return list from TESTSDK_CASE_DIRS."""
+ mingw_dir = mingw_default_dir(d)
+ if mingw_dir:
+ return mingw_dir.split()
+
+ testdirs = d.getVar("TESTSDK_CASE_DIRS")
+ if testdirs:
+ return testdirs.split()
+
+ bb.fatal("TESTSDK_CASE_DIRS unset, can't find SDK test directories.")
+
+ def get_sdk_paths(self, d):
+ """
+ Return a list of paths where SDK test cases reside.
+
+ SDK tests are expected in <LAYER_DIR>/lib/oeqa/<dirname>/cases
+ """
+ paths = []
+ for layer in d.getVar("BBLAYERS").split():
+ for dirname in self.sdk_dir_names(d):
+ case_path = os.path.join(layer, "lib", "oeqa", dirname, "cases")
+ if os.path.isdir(case_path):
+ paths.append(case_path)
+ return paths
+
def get_tcname(self, d):
"""
Get the name of the SDK file
@@ -115,7 +148,7 @@ class TestSDK(TestSDKBase):
try:
modules = (d.getVar("TESTSDK_SUITES") or "").split()
- tc.loadTests(self.context_executor_class.default_cases, modules)
+ tc.loadTests(self.get_sdk_paths(d), modules)
except Exception as e:
import traceback
bb.fatal("Loading tests failed:\n%s" % traceback.format_exc())
similarity index 100%
rename from meta/lib/oeqa/sdk/buildtools-docs-cases/README
rename to meta/lib/oeqa/sdkbuildtools-docs/cases/README
similarity index 100%
rename from meta/lib/oeqa/sdk/buildtools-docs-cases/build.py
rename to meta/lib/oeqa/sdkbuildtools-docs/cases/build.py
similarity index 100%
rename from meta/lib/oeqa/sdk/buildtools-cases/README
rename to meta/lib/oeqa/sdkbuildtools/cases/README
similarity index 100%
rename from meta/lib/oeqa/sdk/buildtools-cases/build.py
rename to meta/lib/oeqa/sdkbuildtools/cases/build.py
similarity index 100%
rename from meta/lib/oeqa/sdk/buildtools-cases/gcc.py
rename to meta/lib/oeqa/sdkbuildtools/cases/gcc.py
similarity index 100%
rename from meta/lib/oeqa/sdk/buildtools-cases/https.py
rename to meta/lib/oeqa/sdkbuildtools/cases/https.py
similarity index 100%
rename from meta/lib/oeqa/sdk/buildtools-cases/sanity.py
rename to meta/lib/oeqa/sdkbuildtools/cases/sanity.py
@@ -16,4 +16,5 @@ TOOLCHAIN_OUTPUTNAME = "${SDK_ARCH}-buildtools-docs-nativesdk-standalone-${DISTR
SDK_TITLE = "Docs Build tools tarball"
-TESTSDK_CASES = "buildtools-docs-cases"
+# Directory that contains testcases
+TESTSDK_CASE_DIRS = "sdkbuildtools-docs"
\ No newline at end of file
@@ -124,22 +124,7 @@ TOOLCHAIN_NEED_CONFIGSITE_CACHE = ""
# The recipe doesn't need any default deps
INHIBIT_DEFAULT_DEPS = "1"
-# Directory in testsdk that contains testcases
-TESTSDK_CASES = "buildtools-cases"
+inherit testsdk
-# We have our own code, avoid deferred inherit
-SDK_CLASSES:remove = "testsdk"
-
-python do_testsdk() {
- import oeqa.sdk.testsdk
- testsdk = oeqa.sdk.testsdk.TestSDK()
-
- cases_path = os.path.join(os.path.abspath(os.path.dirname(oeqa.sdk.testsdk.__file__)), d.getVar("TESTSDK_CASES"))
- testsdk.context_executor_class.default_cases = [cases_path,]
-
- testsdk.run(d)
-}
-addtask testsdk
-do_testsdk[nostamp] = "1"
-do_testsdk[network] = "1"
-do_testsdk[depends] += "xz-native:do_populate_sysroot"
+# Directory that contains testcases
+TESTSDK_CASE_DIRS = "sdkbuildtools"
\ No newline at end of file