diff --git a/scripts/pylib/twister/twisterlib/runner.py b/scripts/pylib/twister/twisterlib/runner.py index be3d64adc08837..28e3dae80cdc83 100644 --- a/scripts/pylib/twister/twisterlib/runner.py +++ b/scripts/pylib/twister/twisterlib/runner.py @@ -329,11 +329,15 @@ def run_cmake(self, args="", filter_stages=[]): warnings_as_errors = 'n' gen_defines_args = "" + warning_command = 'CONFIG_COMPILER_WARNINGS_AS_ERRORS' + if self.testsuite.sysbuild: + warning_command = 'SB_' + warning_command + logger.debug("Running cmake on %s for %s" % (self.source_dir, self.platform.name)) cmake_args = [ f'-B{self.build_dir}', f'-DTC_RUNID={self.instance.run_id}', - f'-DCONFIG_COMPILER_WARNINGS_AS_ERRORS={warnings_as_errors}', + f'-D{warning_command}={warnings_as_errors}', f'-DEXTRA_GEN_DEFINES_ARGS={gen_defines_args}', f'-G{self.env.generator}' ] diff --git a/scripts/tests/twister/test_runner.py b/scripts/tests/twister/test_runner.py index 7a492e94918179..b07ab333f8965d 100644 --- a/scripts/tests/twister/test_runner.py +++ b/scripts/tests/twister/test_runner.py @@ -368,7 +368,7 @@ def mock_popen(*args, **kwargs): None, None, [os.path.join('dummy', 'cmake'), '-B' + os.path.join('build', 'dir'), '-DTC_RUNID=1', - '-DCONFIG_COMPILER_WARNINGS_AS_ERRORS=y', + '-DSB_CONFIG_COMPILER_WARNINGS_AS_ERRORS=y', '-DEXTRA_GEN_DEFINES_ARGS=--edtlib-Werror', '-Gdummy_generator', '-S' + os.path.join('source', 'dir'), 'arg1', 'arg2', @@ -382,7 +382,7 @@ def mock_popen(*args, **kwargs): 'error', 'Cmake build failure', [os.path.join('dummy', 'cmake'), '-B' + os.path.join('build', 'dir'), '-DTC_RUNID=1', - '-DCONFIG_COMPILER_WARNINGS_AS_ERRORS=n', + '-DSB_CONFIG_COMPILER_WARNINGS_AS_ERRORS=n', '-DEXTRA_GEN_DEFINES_ARGS=', '-Gdummy_generator', '-Szephyr_base/share/sysbuild', '-DAPP_DIR=' + os.path.join('source', 'dir'),