@@ -88,6 +88,7 @@ def run_benchmark_on_target(target, script):
88
88
def run_benchmarks (target , param_n , param_m , n_average , test_list ):
89
89
skip_complex = run_feature_test (target , "complex" ) != "complex"
90
90
skip_native = run_feature_test (target , "native_check" ) != "native"
91
+ target_had_error = False
91
92
92
93
for test_file in sorted (test_list ):
93
94
print (test_file + ": " , end = "" )
@@ -147,6 +148,8 @@ def run_benchmarks(target, param_n, param_m, n_average, test_list):
147
148
error = "FAIL truth"
148
149
149
150
if error is not None :
151
+ if not error .startswith ("SKIP" ):
152
+ target_had_error = True
150
153
print (error )
151
154
else :
152
155
t_avg , t_sd = compute_stats (times )
@@ -162,6 +165,8 @@ def run_benchmarks(target, param_n, param_m, n_average, test_list):
162
165
163
166
sys .stdout .flush ()
164
167
168
+ return target_had_error
169
+
165
170
166
171
def parse_output (filename ):
167
172
with open (filename ) as f :
@@ -279,12 +284,15 @@ def main():
279
284
280
285
print ("N={} M={} n_average={}" .format (N , M , n_average ))
281
286
282
- run_benchmarks (target , N , M , n_average , tests )
287
+ target_had_error = run_benchmarks (target , N , M , n_average , tests )
283
288
284
289
if isinstance (target , pyboard .Pyboard ):
285
290
target .exit_raw_repl ()
286
291
target .close ()
287
292
293
+ if target_had_error :
294
+ sys .exit (1 )
295
+
288
296
289
297
if __name__ == "__main__" :
290
298
main ()
0 commit comments