|
7 | 7 |
|
8 | 8 | SUCCEEDED = "\033[32msucceeded\033[0m" |
9 | 9 | FAILED = "\033[31mfailed\033[0m" |
10 | | -SKIPPED = "\033[33mskipped\033[0m" |
11 | | -WARNING = "\033[31mwarnings\033[0m" |
| 10 | +SKIPPED = "\033[36mskipped\033[0m" |
| 11 | +WARNING = "\033[33mwarnings\033[0m " |
12 | 12 |
|
13 | | -all_warnings = False |
14 | 13 | exit_status = 0 |
15 | 14 | success_count = 0 |
16 | 15 | fail_count = 0 |
|
31 | 30 | all_examples = list(glob.iglob('libraries/**/*.ino', recursive=True)) |
32 | 31 | all_examples.sort() |
33 | 32 |
|
34 | | -def errorOutputFilter(line): |
35 | | - if len(line) == 0: |
36 | | - return False |
37 | | - if line.isspace(): # Note: empty string does not match here! |
38 | | - return False |
39 | | - # TODO: additional items to remove? |
40 | | - return True |
41 | | - |
42 | | - |
43 | 33 | def build_examples(variant): |
44 | 34 | global exit_status, success_count, fail_count, skip_count, build_format, build_separator |
45 | 35 |
|
@@ -67,19 +57,12 @@ def build_examples(variant): |
67 | 57 | elif glob.glob(sketchdir+"/.*.test.only") and not os.path.exists(sketchdir + '/.' + variant + '.test.only'): |
68 | 58 | success = SKIPPED |
69 | 59 | else: |
70 | | - # TODO - preferably, would have STDERR show up in **both** STDOUT and STDERR. |
71 | | - # preferably, would use Python logging handler to get both distinct outputs and one merged output |
72 | | - # for now, split STDERR when building with all warnings enabled, so can detect warning/error output. |
73 | | - if all_warnings: |
74 | | - build_result = subprocess.run("arduino-cli compile --warnings all --fqbn {} {}".format(fqbn, sketch), shell=True, stdout=PIPE, stderr=PIPE) |
75 | | - else: |
76 | | - build_result = subprocess.run("arduino-cli compile --warnings default --fqbn {} {}".format(fqbn, sketch), shell=True, stdout=PIPE, stderr=PIPE) |
| 60 | + build_result = subprocess.run("arduino-cli compile --warnings all --fqbn {} {}".format(fqbn, sketch), shell=True, stdout=PIPE, stderr=PIPE) |
77 | 61 |
|
78 | 62 | # get stderr into a form where len(warningLines) indicates a true warning was output to stderr |
79 | 63 | warningLines = []; |
80 | | - if all_warnings and build_result.stderr: |
81 | | - tmpWarningLines = build_result.stderr.decode("utf-8").splitlines() |
82 | | - warningLines = list(filter(errorOutputFilter, (tmpWarningLines))) |
| 64 | + if build_result.stderr: |
| 65 | + warningLines = build_result.stderr.decode("utf-8").splitlines() |
83 | 66 |
|
84 | 67 | if build_result.returncode != 0: |
85 | 68 | exit_status = build_result.returncode |
|
0 commit comments