Skip to content

Commit c92f594

Browse files
Fix exit status propagation if a test suite is killed by a signal
Signed-off-by: Gilles Peskine <[email protected]>
1 parent 6815b87 commit c92f594

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

tools/bin/mbedtls-run-tests

+8-2
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ def filter_test_cases(all_datax, tcf, temp_datax):
7474
def run_exe(keep_temp, precommand, exe, extra_options, all_datax, tcf):
7575
"""Run one Mbed TLS test suites based on the specified options.
7676
77+
Return the subprocess's exit status (should be 0 for success, 1 for
78+
a test failure, 2 on operational error), or a negative code if it was
79+
killed by a signal.
80+
7781
See `main` for what options are valid.
7882
"""
7983
directory = os.path.dirname(exe)
@@ -121,8 +125,10 @@ def run(options):
121125
status = run_exe(options.keep,
122126
options.command, exe, extra_options,
123127
data_file, tcf)
124-
if status > global_status:
125-
global_status = status
128+
if status > 0: # test failure or operational error
129+
global_status = max(global_status, status)
130+
elif status < 0: # killed by a signal
131+
global_status = max(global_status, 120)
126132
return global_status
127133

128134
def main():

0 commit comments

Comments
 (0)