Skip to content

Commit 66769cf

Browse files
krish2718nashif
authored andcommitted
scripts: twister: Fix return value for size
If size is given then twister prnits the size information for the ELF but returns one which if used in automation fails the command. Return zero as the command is successful. Also, fix the unit test case. Signed-off-by: Chaitanya Tata <[email protected]>
1 parent 485fa94 commit 66769cf

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

scripts/pylib/twister/twisterlib/environment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@ def parse_arguments(parser, args, options = None):
745745
for fn in options.size:
746746
sc = SizeCalculator(fn, [])
747747
sc.size_report()
748-
sys.exit(1)
748+
sys.exit(0)
749749

750750
if len(options.extra_test_args) > 0:
751751
# extra_test_args is a list of CLI args that Twister did not recognize

scripts/tests/twister/test_environment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ def mock_calc(*args, **kwargs):
190190
with pytest.raises(SystemExit) as exit_info:
191191
twisterlib.environment.parse_arguments(parser, args)
192192

193-
assert exit_info.value.code == 1
193+
assert exit_info.value.code == 0
194194

195195
mock_calc_parent.child.assert_has_calls([mock.call(('dummy.elf', []), {})])
196196
mock_calc_parent.child().size_report.assert_has_calls([mock.call()])

0 commit comments

Comments
 (0)