|
7 | 7 |
|
8 | 8 | SUCCEEDED = "\033[32msucceeded\033[0m" |
9 | 9 | FAILED = "\033[31mfailed\033[0m" |
10 | | -SKIPPED = "\033[36mskipped\033[0m" |
| 10 | +SKIPPED = "\033[35mskipped\033[0m" |
11 | 11 | WARNING = "\033[33mwarnings\033[0m " |
12 | 12 |
|
13 | 13 | exit_status = 0 |
@@ -54,42 +54,37 @@ def build_examples(variant): |
54 | 54 | sketchdir = os.path.dirname(sketch) |
55 | 55 | if os.path.exists(sketchdir + '/.all.test.skip') or os.path.exists(sketchdir + '/.' + variant + '.test.skip'): |
56 | 56 | success = SKIPPED |
| 57 | + skip_count += 1 |
57 | 58 | elif glob.glob(sketchdir+"/.*.test.only") and not os.path.exists(sketchdir + '/.' + variant + '.test.only'): |
58 | 59 | success = SKIPPED |
| 60 | + skip_count += 1 |
59 | 61 | else: |
60 | 62 | build_result = subprocess.run("arduino-cli compile --warnings all --fqbn {} {}".format(fqbn, sketch), shell=True, stdout=PIPE, stderr=PIPE) |
61 | 63 |
|
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 |
67 | 65 | if build_result.returncode != 0: |
68 | 66 | exit_status = build_result.returncode |
69 | 67 | success = FAILED |
70 | 68 | fail_count += 1 |
71 | | - elif len(warningLines) != 0: |
72 | | - exit_status = -1 |
73 | | - success = WARNING |
74 | | - fail_count += 1 |
75 | 69 | else: |
76 | | - success = SUCCEEDED |
77 | 70 | success_count += 1 |
| 71 | + if build_result.stderr: |
| 72 | + success = WARNING |
| 73 | + else: |
| 74 | + success = SUCCEEDED |
78 | 75 |
|
79 | 76 | build_duration = time.monotonic() - start_time |
80 | 77 |
|
81 | 78 | print(build_format.format(sketch.split(os.path.sep)[1], os.path.basename(sketch), success, '{:5.2f}s'.format(build_duration))) |
82 | 79 |
|
83 | 80 | if success != SKIPPED: |
| 81 | + # Build failed |
84 | 82 | if build_result.returncode != 0: |
85 | 83 | 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")) |
93 | 88 |
|
94 | 89 | build_time = time.monotonic() |
95 | 90 |
|
|
0 commit comments