|
80 | 80 | skip_count = 0 |
81 | 81 |
|
82 | 82 | # format |
83 | | -build_format = "| {:8} | {:44} | {:9} " |
| 83 | +build_format_header = "| {:^8} | {:42} | {:^10} | {:^7} |" |
| 84 | +build_format_result = "| {:^8} | {:42} | {:^19} | {:^6.2f}s |" |
84 | 85 | build_separator = "-" * 80 |
85 | 86 |
|
86 | 87 |
|
@@ -495,31 +496,37 @@ def check_status(status, build_conf, boardKo): |
495 | 496 | elif status[1] == 1: |
496 | 497 | # Check if failed due to a region overflowed |
497 | 498 | logFile = os.path.join(build_conf[3], sketch_name + ".log") |
| 499 | + error_pattern = re.compile(":\\d+:\\d+:\\serror:\\s") |
498 | 500 | ld_pattern = re.compile("arm-none-eabi/bin/ld:") |
499 | 501 | overflow_pattern = re.compile( |
500 | 502 | "will not fit in region|region .+ overflowed by [\\d]+ bytes" |
501 | 503 | ) |
| 504 | + error_found = False |
502 | 505 | for i, line in enumerate(open(logFile)): |
503 | | - if ld_pattern.search(line): |
| 506 | + if error_pattern.search(line): |
| 507 | + error_found = True |
| 508 | + elif ld_pattern.search(line): |
504 | 509 | # If one ld line is not for region overflowed --> failed |
505 | 510 | if overflow_pattern.search(line) is None: |
506 | | - result = "\033[31mfailed\033[0m " |
507 | | - boardKo.append(build_conf[0]) |
508 | | - if args.ci: |
509 | | - cat(logFile) |
510 | | - nb_build_failed += 1 |
511 | | - break |
| 511 | + error_found = True |
| 512 | + if error_found: |
| 513 | + result = "\033[31mfailed\033[0m" |
| 514 | + boardKo.append(build_conf[0]) |
| 515 | + if args.ci: |
| 516 | + cat(logFile) |
| 517 | + nb_build_failed += 1 |
| 518 | + break |
512 | 519 | else: |
513 | 520 | # else consider it succeeded |
514 | | - result = "\033[32msucceeded\033[0m" |
| 521 | + result = "\033[32msucceeded*\033[0m" |
515 | 522 | if args.bin: |
516 | 523 | empty_bin(build_conf[0], sketch_name) |
517 | 524 | nb_build_passed += 1 |
518 | 525 | else: |
519 | | - result = "\033[31merror\033[0m " |
| 526 | + result = "\033[31merror\033[0m" |
520 | 527 |
|
521 | 528 | print( |
522 | | - (build_format + "| {:5.2f}s |").format( |
| 529 | + (build_format_result).format( |
523 | 530 | "{}/{}".format(build_conf[1], build_conf[2]), |
524 | 531 | build_conf[0], |
525 | 532 | result, |
@@ -730,12 +737,12 @@ def build_config(sketch, boardSkipped): |
730 | 737 | for pattern in na_sketch_pattern[build_conf_list[idx][0]]: |
731 | 738 | if re.search(pattern, sketch, re.IGNORECASE): |
732 | 739 | print( |
733 | | - (build_format + "| {:5.2f}s |").format( |
| 740 | + (build_format_result).format( |
734 | 741 | "{}/{}".format( |
735 | 742 | build_conf_list[idx][1], build_conf_list[idx][2] |
736 | 743 | ), |
737 | 744 | build_conf_list[idx][0], |
738 | | - "\033[33mskipped\033[0m ", |
| 745 | + "\033[33mskipped\033[0m", |
739 | 746 | 0.00, |
740 | 747 | ) |
741 | 748 | ) |
@@ -782,7 +789,7 @@ def build_all(): |
782 | 789 | for line in wrapped_path_: |
783 | 790 | print("| {:^76} |".format("{}".format(line))) |
784 | 791 | print(build_separator) |
785 | | - print((build_format + "| {:6} |").format("Num", "Board", "Result", "Time")) |
| 792 | + print((build_format_header).format("Num", "Board", "Result", "Time")) |
786 | 793 | print(build_separator) |
787 | 794 |
|
788 | 795 | build_conf_list = build_config(sketch, boardSkipped) |
|
0 commit comments