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 <Torsten.Rasmussen@nordicsemi.no>
This commit is contained in:
Torsten Rasmussen 2025-03-31 12:00:20 +02:00 committed by Benjamin Cabé
commit 483c76759d

View file

@ -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]