5
5
import subprocess
6
6
import collections
7
7
8
- # optional wall option
9
- BUILD_WARNING = 'default'
8
+ # optional wall option cause build failed if has warnings
9
+ BUILD_WALL = False
10
10
if "--wall" in sys .argv :
11
- BUILD_WARNING = 'all'
11
+ BUILD_WALL = True
12
12
sys .argv .remove ("--wall" )
13
13
14
14
# add user bin to path!
@@ -231,13 +231,13 @@ def test_examples_in_folder(folderpath):
231
231
ColorPrint .print_warn ("skipping" )
232
232
continue
233
233
234
- cmd = ['arduino-cli' , 'compile' , '--warnings' , BUILD_WARNING , '--fqbn' , fqbn , examplepath ]
234
+ cmd = ['arduino-cli' , 'compile' , '--warnings' , 'all' , '--fqbn' , fqbn , examplepath ]
235
235
proc = subprocess .Popen (cmd , stdout = subprocess .PIPE ,
236
236
stderr = subprocess .PIPE )
237
237
r = proc .wait ()
238
238
out = proc .stdout .read ()
239
239
err = proc .stderr .read ()
240
- if r == 0 :
240
+ if r == 0 and not ( err and BUILD_WALL == True ) :
241
241
ColorPrint .print_pass (CHECK )
242
242
if err :
243
243
# also print out warning message
@@ -257,7 +257,7 @@ def test_examples_in_learningrepo(folderpath):
257
257
continue
258
258
if not projectpath .endswith (".ino" ):
259
259
continue
260
- # found an INO!
260
+ # found an INO!
261
261
print ('\t ' + projectpath , end = ' ' )
262
262
# check if we should SKIP
263
263
skipfilename = folderpath + "/." + platform + ".test.skip"
@@ -269,7 +269,7 @@ def test_examples_in_learningrepo(folderpath):
269
269
ColorPrint .print_warn ("skipping" )
270
270
continue
271
271
272
- cmd = ['arduino-cli' , 'compile' , '--warnings' , BUILD_WARNING , '--fqbn' , fqbn , projectpath ]
272
+ cmd = ['arduino-cli' , 'compile' , '--warnings' , 'all' , '--fqbn' , fqbn , projectpath ]
273
273
proc = subprocess .Popen (cmd , stdout = subprocess .PIPE ,
274
274
stderr = subprocess .PIPE )
275
275
r = proc .wait ()
0 commit comments