Skip to content

Commit 6e3ba93

Browse files
committed
build with all warnings (not as error)
1 parent f655a05 commit 6e3ba93

File tree

1 file changed

+13
-18
lines changed

1 file changed

+13
-18
lines changed

tools/build_all.py

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
SUCCEEDED = "\033[32msucceeded\033[0m"
99
FAILED = "\033[31mfailed\033[0m"
10-
SKIPPED = "\033[36mskipped\033[0m"
10+
SKIPPED = "\033[35mskipped\033[0m"
1111
WARNING = "\033[33mwarnings\033[0m "
1212

1313
exit_status = 0
@@ -54,42 +54,37 @@ def build_examples(variant):
5454
sketchdir = os.path.dirname(sketch)
5555
if os.path.exists(sketchdir + '/.all.test.skip') or os.path.exists(sketchdir + '/.' + variant + '.test.skip'):
5656
success = SKIPPED
57+
skip_count += 1
5758
elif glob.glob(sketchdir+"/.*.test.only") and not os.path.exists(sketchdir + '/.' + variant + '.test.only'):
5859
success = SKIPPED
60+
skip_count += 1
5961
else:
6062
build_result = subprocess.run("arduino-cli compile --warnings all --fqbn {} {}".format(fqbn, sketch), shell=True, stdout=PIPE, stderr=PIPE)
6163

62-
# get stderr into a form where len(warningLines) indicates a true warning was output to stderr
63-
warningLines = [];
64-
if build_result.stderr:
65-
warningLines = build_result.stderr.decode("utf-8").splitlines()
66-
64+
# get stderr into a form where warning/error was output to stderr
6765
if build_result.returncode != 0:
6866
exit_status = build_result.returncode
6967
success = FAILED
7068
fail_count += 1
71-
elif len(warningLines) != 0:
72-
exit_status = -1
73-
success = WARNING
74-
fail_count += 1
7569
else:
76-
success = SUCCEEDED
7770
success_count += 1
71+
if build_result.stderr:
72+
success = WARNING
73+
else:
74+
success = SUCCEEDED
7875

7976
build_duration = time.monotonic() - start_time
8077

8178
print(build_format.format(sketch.split(os.path.sep)[1], os.path.basename(sketch), success, '{:5.2f}s'.format(build_duration)))
8279

8380
if success != SKIPPED:
81+
# Build failed
8482
if build_result.returncode != 0:
8583
print(build_result.stdout.decode("utf-8"))
86-
if (build_result.stderr):
87-
print(build_result.stderr.decode("utf-8"))
88-
if len(warningLines) != 0:
89-
for line in warningLines:
90-
print(line)
91-
else:
92-
skip_count += 1
84+
85+
# Build with warnings
86+
if build_result.stderr:
87+
print(build_result.stderr.decode("utf-8"))
9388

9489
build_time = time.monotonic()
9590

0 commit comments

Comments
 (0)