From 483c76759df9c520fea8df1663a2a0199c8808d6 Mon Sep 17 00:00:00 2001 From: Torsten Rasmussen Date: Mon, 31 Mar 2025 12:00:20 +0200 Subject: [PATCH] scripts: support quoted sysbuild Kconfig settings in twister Kconfig settings of string type is passed to CMake with quotes to ensure they are properly handled, for example when specified in testcase.yml as > extra_args: > - CONFIG_FOO="bar" Support sysbuild Kconfig settings `SB_CONFIG` by performing the same quoting for settings starting with `SB_CONFIG_`. Signed-off-by: Torsten Rasmussen --- scripts/pylib/twister/twisterlib/runner.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/pylib/twister/twisterlib/runner.py b/scripts/pylib/twister/twisterlib/runner.py index 801e68c8c95..54524757e7c 100644 --- a/scripts/pylib/twister/twisterlib/runner.py +++ b/scripts/pylib/twister/twisterlib/runner.py @@ -1666,8 +1666,8 @@ class ProjectBuilder(FilterBuilder): extra_dtc_overlay_files, cmake_extra_args, build_dir): # Retain quotes around config options - config_options = [arg for arg in extra_args if arg.startswith("CONFIG_")] - args = [arg for arg in extra_args if not arg.startswith("CONFIG_")] + config_options = [arg for arg in extra_args if arg.startswith(("CONFIG_", "SB_CONFIG_"))] + args = [arg for arg in extra_args if not arg.startswith(("CONFIG_", "SB_CONFIG_"))] args_expanded = ["-D{}".format(a.replace('"', '\"')) for a in config_options]