build with all warnings (not as error)
This commit is contained in:
1 file changed
+13
-18
+13
-18
@@ -7,7 +7,7 @@ import time
|
||||
|
||||
SUCCEEDED = "\033[32msucceeded\033[0m"
|
||||
FAILED = "\033[31mfailed\033[0m"
|
||||
SKIPPED = "\033[36mskipped\033[0m"
|
||||
SKIPPED = "\033[35mskipped\033[0m"
|
||||
WARNING = "\033[33mwarnings\033[0m "
|
||||
|
||||
exit_status = 0
|
||||
@@ -54,42 +54,37 @@ def build_examples(variant):
|
||||
sketchdir = os.path.dirname(sketch)
|
||||
if os.path.exists(sketchdir + '/.all.test.skip') or os.path.exists(sketchdir + '/.' + variant + '.test.skip'):
|
||||
success = SKIPPED
|
||||
skip_count += 1
|
||||
elif glob.glob(sketchdir+"/.*.test.only") and not os.path.exists(sketchdir + '/.' + variant + '.test.only'):
|
||||
success = SKIPPED
|
||||
skip_count += 1
|
||||
else:
|
||||
build_result = subprocess.run("arduino-cli compile --warnings all --fqbn {} {}".format(fqbn, sketch), shell=True, stdout=PIPE, stderr=PIPE)
|
||||
|
||||
# get stderr into a form where len(warningLines) indicates a true warning was output to stderr
|
||||
warningLines = [];
|
||||
if build_result.stderr:
|
||||
warningLines = build_result.stderr.decode("utf-8").splitlines()
|
||||
|
||||
# get stderr into a form where warning/error was output to stderr
|
||||
if build_result.returncode != 0:
|
||||
exit_status = build_result.returncode
|
||||
success = FAILED
|
||||
fail_count += 1
|
||||
elif len(warningLines) != 0:
|
||||
exit_status = -1
|
||||
success = WARNING
|
||||
fail_count += 1
|
||||
else:
|
||||
success = SUCCEEDED
|
||||
success_count += 1
|
||||
if build_result.stderr:
|
||||
success = WARNING
|
||||
else:
|
||||
success = SUCCEEDED
|
||||
|
||||
build_duration = time.monotonic() - start_time
|
||||
|
||||
print(build_format.format(sketch.split(os.path.sep)[1], os.path.basename(sketch), success, '{:5.2f}s'.format(build_duration)))
|
||||
|
||||
if success != SKIPPED:
|
||||
# Build failed
|
||||
if build_result.returncode != 0:
|
||||
print(build_result.stdout.decode("utf-8"))
|
||||
if (build_result.stderr):
|
||||
print(build_result.stderr.decode("utf-8"))
|
||||
if len(warningLines) != 0:
|
||||
for line in warningLines:
|
||||
print(line)
|
||||
else:
|
||||
skip_count += 1
|
||||
|
||||
# Build with warnings
|
||||
if build_result.stderr:
|
||||
print(build_result.stderr.decode("utf-8"))
|
||||
|
||||
build_time = time.monotonic()
|
||||
|
||||
|
||||
Reference in new issue
Block a user