Skip to content

Commit 6f68a8c

Browse files
committed
tests/run-perfbench.py: Return error code if any test fails on target.
Signed-off-by: Damien George <[email protected]>
1 parent d7cf8a3 commit 6f68a8c

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

tests/run-perfbench.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ def run_benchmark_on_target(target, script):
8888
def run_benchmarks(target, param_n, param_m, n_average, test_list):
8989
skip_complex = run_feature_test(target, "complex") != "complex"
9090
skip_native = run_feature_test(target, "native_check") != "native"
91+
target_had_error = False
9192

9293
for test_file in sorted(test_list):
9394
print(test_file + ": ", end="")
@@ -147,6 +148,8 @@ def run_benchmarks(target, param_n, param_m, n_average, test_list):
147148
error = "FAIL truth"
148149

149150
if error is not None:
151+
if not error.startswith("SKIP"):
152+
target_had_error = True
150153
print(error)
151154
else:
152155
t_avg, t_sd = compute_stats(times)
@@ -162,6 +165,8 @@ def run_benchmarks(target, param_n, param_m, n_average, test_list):
162165

163166
sys.stdout.flush()
164167

168+
return target_had_error
169+
165170

166171
def parse_output(filename):
167172
with open(filename) as f:
@@ -279,12 +284,15 @@ def main():
279284

280285
print("N={} M={} n_average={}".format(N, M, n_average))
281286

282-
run_benchmarks(target, N, M, n_average, tests)
287+
target_had_error = run_benchmarks(target, N, M, n_average, tests)
283288

284289
if isinstance(target, pyboard.Pyboard):
285290
target.exit_raw_repl()
286291
target.close()
287292

293+
if target_had_error:
294+
sys.exit(1)
295+
288296

289297
if __name__ == "__main__":
290298
main()

0 commit comments

Comments
 (0)