testsdk: allow user to specify which tests to run

Following the usage of TEST_SUITES in testimage, add TESTSDK_SUITES to
specify the list of tests to execute. By default the variable is empty,
which means to run all discovered tests.

This makes it easier to work on a single test without having to run all
of the tests.

(From OE-Core rev: 28d437c52c77889b2ede0fc2f2d6777c5b0a553d)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Ross Burton 2025-05-10 09:43:35 +01:00 committed by Richard Purdie
parent 234b7ce514
commit cabcadd9be
3 changed files with 7 additions and 2 deletions

View File

@ -14,6 +14,9 @@
# #
# where "<image-name>" is an image like core-image-sato. # where "<image-name>" is an image like core-image-sato.
# List of test modules to run, or run all that can be found if unset
TESTSDK_SUITES ?= ""
TESTSDK_CLASS_NAME ?= "oeqa.sdk.testsdk.TestSDK" TESTSDK_CLASS_NAME ?= "oeqa.sdk.testsdk.TestSDK"
TESTSDKEXT_CLASS_NAME ?= "oeqa.sdkext.testsdk.TestSDKExt" TESTSDKEXT_CLASS_NAME ?= "oeqa.sdkext.testsdk.TestSDKExt"

View File

@ -114,7 +114,8 @@ class TestSDK(TestSDKBase):
host_pkg_manifest=host_pkg_manifest, **context_args) host_pkg_manifest=host_pkg_manifest, **context_args)
try: try:
tc.loadTests(self.context_executor_class.default_cases) modules = (d.getVar("TESTSDK_SUITES") or "").split()
tc.loadTests(self.context_executor_class.default_cases, modules)
except Exception as e: except Exception as e:
import traceback import traceback
bb.fatal("Loading tests failed:\n%s" % traceback.format_exc()) bb.fatal("Loading tests failed:\n%s" % traceback.format_exc())

View File

@ -82,7 +82,8 @@ class TestSDKExt(TestSDKBase):
host_pkg_manifest=host_pkg_manifest) host_pkg_manifest=host_pkg_manifest)
try: try:
tc.loadTests(OESDKExtTestContextExecutor.default_cases) modules = (d.getVar("TESTSDK_SUITES") or "").split()
tc.loadTests(OESDKExtTestContextExecutor.default_cases, modules)
except Exception as e: except Exception as e:
import traceback import traceback
bb.fatal("Loading tests failed:\n%s" % traceback.format_exc()) bb.fatal("Loading tests failed:\n%s" % traceback.format_exc())