Skip to content

Commit d2bae91

Browse files
pdgendtcarlescufi
authored andcommitted
scripts: pylib: twister: Pass testsuite name to cmake
Add a CMake argument with the current testsuite name. Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
1 parent d2fb077 commit d2bae91

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

scripts/pylib/twister/twisterlib/runner.py

+1
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,7 @@ def run_cmake(self, args="", filter_stages=[]):
343343
cmake_args = [
344344
f'-B{self.build_dir}',
345345
f'-DTC_RUNID={self.instance.run_id}',
346+
f'-DTC_NAME={self.instance.testsuite.name}',
346347
f'-D{warning_command}={warnings_as_errors}',
347348
f'-DEXTRA_GEN_DEFINES_ARGS={gen_defines_args}',
348349
f'-G{self.env.generator}'

scripts/tests/twister/test_runner.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ def mock_popen(*args, **kwargs):
369369
True, True, False,
370370
TwisterStatus.NONE, None,
371371
[os.path.join('dummy', 'cmake'),
372-
'-B' + os.path.join('build', 'dir'), '-DTC_RUNID=1',
372+
'-B' + os.path.join('build', 'dir'), '-DTC_RUNID=1', '-DTC_NAME=testcase',
373373
'-DSB_CONFIG_COMPILER_WARNINGS_AS_ERRORS=y',
374374
'-DEXTRA_GEN_DEFINES_ARGS=--edtlib-Werror', '-Gdummy_generator',
375375
'-S' + os.path.join('source', 'dir'),
@@ -383,7 +383,7 @@ def mock_popen(*args, **kwargs):
383383
True, False, True,
384384
TwisterStatus.ERROR, 'Cmake build failure',
385385
[os.path.join('dummy', 'cmake'),
386-
'-B' + os.path.join('build', 'dir'), '-DTC_RUNID=1',
386+
'-B' + os.path.join('build', 'dir'), '-DTC_RUNID=1', '-DTC_NAME=testcase',
387387
'-DSB_CONFIG_COMPILER_WARNINGS_AS_ERRORS=n',
388388
'-DEXTRA_GEN_DEFINES_ARGS=', '-Gdummy_generator',
389389
'-Szephyr_base/share/sysbuild',
@@ -442,6 +442,7 @@ def mock_popen(*args, **kwargs):
442442
instance_mock.status = TwisterStatus.NONE
443443
instance_mock.reason = None
444444
instance_mock.testsuite = mock.Mock()
445+
instance_mock.testsuite.name = 'testcase'
445446
instance_mock.testsuite.required_snippets = ['dummy snippet 1', 'ds2']
446447
instance_mock.testcases = [mock.Mock(), mock.Mock()]
447448
instance_mock.testcases[0].status = TwisterStatus.NONE

0 commit comments

Comments
 (0)