]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
testsdk: allow user to specify which tests to run
authorRoss Burton <ross.burton@arm.com>
Sat, 10 May 2025 08:43:35 +0000 (09:43 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 12 May 2025 09:52:52 +0000 (10:52 +0100)
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.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes-recipe/testsdk.bbclass
meta/lib/oeqa/sdk/testsdk.py
meta/lib/oeqa/sdkext/testsdk.py

index fd82e6ef41d5077ac31961269534d52d33465a21..59d2834c9929a900f3607469b97b9a0d9346106f 100644 (file)
@@ -14,6 +14,9 @@
 #
 # 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"
 TESTSDKEXT_CLASS_NAME ?= "oeqa.sdkext.testsdk.TestSDKExt"
 
index 518b09febb61fa1c54aac8cd88efecccbdaa6d84..52b702b6a2806294b8c84cc849a577284e4d30bc 100644 (file)
@@ -114,7 +114,8 @@ class TestSDK(TestSDKBase):
                 host_pkg_manifest=host_pkg_manifest, **context_args)
 
             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:
                 import traceback
                 bb.fatal("Loading tests failed:\n%s" % traceback.format_exc())
index 9d5a99d900fd195c90cf15ef87ca7a5fd0860481..6dc23065a4a098c42dda91c262bd96e689e3648e 100644 (file)
@@ -82,7 +82,8 @@ class TestSDKExt(TestSDKBase):
                 host_pkg_manifest=host_pkg_manifest)
 
             try:
-                tc.loadTests(OESDKExtTestContextExecutor.default_cases)
+                modules = (d.getVar("TESTSDK_SUITES") or "").split()
+                tc.loadTests(OESDKExtTestContextExecutor.default_cases, modules)
             except Exception as e:
                 import traceback
                 bb.fatal("Loading tests failed:\n%s" % traceback.format_exc())