@@ -194,15 +194,16 @@ def _modules_packages(app, board, jobs, env, cwd, args):
194
194
_print_module_or_pkg_mismatch (app , board , lines , args )
195
195
196
196
197
- def _build (app , board , jobs , env , cwd , args ):
197
+ def _build (app , board , toolchain , jobs , env , cwd , args ):
198
198
cmd = (f'/bin/bash -c "source .murdock; JOBS={ jobs } '
199
- f'compile { app } { board } :gnu "' )
199
+ f'compile { app } { board } :{ toolchain } "' )
200
200
try :
201
201
out = __exec_cmd (cmd , shell = True , env = env , cwd = cwd ,
202
202
stderr = subprocess .STDOUT )
203
203
if args .very_very_verbose :
204
204
print (out )
205
205
print (f"{ app : <30} { board : <30} PASS" )
206
+ return True
206
207
except subprocess .CalledProcessError as err :
207
208
err .output = err .output .decode ("utf-8" , errors = "replace" )
208
209
lines = err .output .split ("\n " )
@@ -215,6 +216,7 @@ def _build(app, board, jobs, env, cwd, args):
215
216
print (f"{ app : <30} { board : <30} FAIL: Kconfig hash mismatch" )
216
217
else :
217
218
print (f"{ app : <30} { board : <30} FAIL" )
219
+ return False
218
220
219
221
220
222
def main ():
@@ -235,6 +237,8 @@ def main():
235
237
parser .add_argument ("-a" , "--apps" , nargs = "+" ,
236
238
help = ("A list of apps to test on the supported boards."
237
239
" If empty we will choose what is tested." ))
240
+ parser .add_argument ("-t" , "--toolchain" , choices = ["gnu" , "llvm" ], default = "gnu" ,
241
+ help = ("Toolchain to use" ))
238
242
parser .add_argument ("-d" , "--dry-run" , action = "store_true" ,
239
243
help = ("Show each of the boards and apps to be compiled"
240
244
" without spending super long to compile them" ))
@@ -261,6 +265,7 @@ def main():
261
265
if 'all' in apps :
262
266
apps = _all_apps (riot_dir )
263
267
268
+ ret = 0
264
269
for app in apps :
265
270
test_dir = str (pathlib .PurePath (riot_dir , app ))
266
271
if not pathlib .Path (test_dir ).exists ():
@@ -281,9 +286,12 @@ def main():
281
286
_modules_packages (app , board , args .jobs , full_env , riot_dir ,
282
287
args )
283
288
else :
284
- _build (app , board , args .jobs , full_env , riot_dir , args )
289
+ if not _build (app , board , args .toolchain , args .jobs , full_env ,
290
+ riot_dir , args ):
291
+ ret = - 1
285
292
elapse_time = datetime .datetime .now () - start_time
286
293
_end (elapse_time .total_seconds (), args .jobs )
294
+ exit (ret )
287
295
288
296
289
297
if __name__ == '__main__' :
0 commit comments