Skip to content

Commit 2836f49

Browse files
author
Zsolt Borbély
committed
Fix run-tests.py: don't override the return value of a testrun
JerryScript-DCO-1.0-Signed-off-by: Zsolt Borbély [email protected]
1 parent 2eb2b22 commit 2836f49

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

tools/run-tests.py

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -112,51 +112,51 @@ def create_binary(buildoptions):
112112
return 0
113113

114114
def run_jerry_tests():
115+
ret_build = ret_test = 0
115116
for job in jerry_tests_options:
116-
ret = create_binary(job.build_args)
117+
ret_build = create_binary(job.build_args)
118+
if ret_build:
119+
break
117120

118-
if not ret:
119-
test_cmd = [TEST_RUNNER_SCRIPT, get_binary_path(job.out_dir), JERRY_TESTS_DIR]
120-
if job.test_args:
121-
test_cmd.extend(job.test_args)
121+
test_cmd = [TEST_RUNNER_SCRIPT, get_binary_path(job.out_dir), JERRY_TESTS_DIR]
122+
if job.test_args:
123+
test_cmd.extend(job.test_args)
122124

123-
ret = run_check(test_cmd)
124-
else:
125-
break
125+
ret_test |= run_check(test_cmd)
126126

127-
return ret
127+
return ret_build | ret_test
128128

129129
def run_jerry_test_suite():
130+
ret_build = ret_test = 0
130131
for job in jerry_test_suite_options:
131-
ret = create_binary(job.build_args)
132+
ret_build = create_binary(job.build_args)
133+
if ret_build:
134+
break
132135

133-
if not ret:
134-
test_cmd = [TEST_RUNNER_SCRIPT, get_binary_path(job.out_dir)]
136+
test_cmd = [TEST_RUNNER_SCRIPT, get_binary_path(job.out_dir)]
135137

136-
if '--profile=minimal' in job.build_args:
137-
test_cmd.append(JERRY_TEST_SUITE_MINIMAL_LIST)
138-
else:
139-
test_cmd.append(JERRY_TEST_SUITE_DIR)
138+
if '--profile=minimal' in job.build_args:
139+
test_cmd.append(JERRY_TEST_SUITE_MINIMAL_LIST)
140+
else:
141+
test_cmd.append(JERRY_TEST_SUITE_DIR)
140142

141-
if job.test_args:
142-
test_cmd.extend(job.test_args)
143+
if job.test_args:
144+
test_cmd.extend(job.test_args)
143145

144-
ret = run_check(test_cmd)
145-
else:
146-
break
146+
ret_test |= run_check(test_cmd)
147147

148-
return ret
148+
return ret_build | ret_test
149149

150150
def run_unittests():
151+
ret_build = ret_test = 0
151152
for job in jerry_unittests_options:
152-
ret = create_binary(job.build_args)
153-
154-
if not ret:
155-
ret = run_check([UNITTEST_RUNNER_SCRIPT, get_bin_dir_path(job.out_dir)])
156-
else:
153+
ret_build = create_binary(job.build_args)
154+
if ret_build:
157155
break
158156

159-
return ret
157+
ret_test |= run_check([UNITTEST_RUNNER_SCRIPT, get_bin_dir_path(job.out_dir)])
158+
159+
return ret_build | ret_test
160160

161161
def run_buildoption_test():
162162
for job in jerry_buildoptions:

0 commit comments

Comments
 (0)