Skip to content

Commit 3777b86

Browse files
PerMacnordicjm
authored andcommitted
twister: Use proper warnings-to-errors command for sysbuild
If sysbuild is used a flag SB_CONFIG_COMPILER_WARNINGS_AS_ERRORS has to be used in order to turn warings to errors on all images. Align pytest tests with the change. Fixes: zephyrproject-rtos#67360 Signed-off-by: Maciej Perkowski <[email protected]>
1 parent bd06b74 commit 3777b86

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

scripts/pylib/twister/twisterlib/runner.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,11 +329,15 @@ def run_cmake(self, args="", filter_stages=[]):
329329
warnings_as_errors = 'n'
330330
gen_defines_args = ""
331331

332+
warning_command = 'CONFIG_COMPILER_WARNINGS_AS_ERRORS'
333+
if self.testsuite.sysbuild:
334+
warning_command = 'SB_' + warning_command
335+
332336
logger.debug("Running cmake on %s for %s" % (self.source_dir, self.platform.name))
333337
cmake_args = [
334338
f'-B{self.build_dir}',
335339
f'-DTC_RUNID={self.instance.run_id}',
336-
f'-DCONFIG_COMPILER_WARNINGS_AS_ERRORS={warnings_as_errors}',
340+
f'-D{warning_command}={warnings_as_errors}',
337341
f'-DEXTRA_GEN_DEFINES_ARGS={gen_defines_args}',
338342
f'-G{self.env.generator}'
339343
]

scripts/tests/twister/test_runner.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ def mock_popen(*args, **kwargs):
368368
None, None,
369369
[os.path.join('dummy', 'cmake'),
370370
'-B' + os.path.join('build', 'dir'), '-DTC_RUNID=1',
371-
'-DCONFIG_COMPILER_WARNINGS_AS_ERRORS=y',
371+
'-DSB_CONFIG_COMPILER_WARNINGS_AS_ERRORS=y',
372372
'-DEXTRA_GEN_DEFINES_ARGS=--edtlib-Werror', '-Gdummy_generator',
373373
'-S' + os.path.join('source', 'dir'),
374374
'arg1', 'arg2',
@@ -382,7 +382,7 @@ def mock_popen(*args, **kwargs):
382382
'error', 'Cmake build failure',
383383
[os.path.join('dummy', 'cmake'),
384384
'-B' + os.path.join('build', 'dir'), '-DTC_RUNID=1',
385-
'-DCONFIG_COMPILER_WARNINGS_AS_ERRORS=n',
385+
'-DSB_CONFIG_COMPILER_WARNINGS_AS_ERRORS=n',
386386
'-DEXTRA_GEN_DEFINES_ARGS=', '-Gdummy_generator',
387387
'-Szephyr_base/share/sysbuild',
388388
'-DAPP_DIR=' + os.path.join('source', 'dir'),

0 commit comments

Comments
 (0)