74
74
sketch_options = {} # key: sketch pattern, value: options
75
75
na_sketch_pattern = {} # key: board name, value: sketch pattern list
76
76
77
- all_warnings = False
78
-
79
77
# Counter
80
78
nb_build_passed = 0
81
79
nb_build_failed = 0
82
80
nb_build_skipped = 0
81
+ nb_warnings = 0
83
82
84
83
# Timing
85
84
full_buildTime = time .time ()
95
94
overflow_pattern = re .compile (
96
95
r"(will not fit in |section .+ is not within )?region( .+ overflowed by [\d]+ bytes)?"
97
96
)
98
-
97
+ warning_pattern = re . compile ( r"warning: .+LOAD segment with RWX permissions" )
99
98
# format
100
99
build_format_header = "| {:^8} | {:42} | {:^10} | {:^7} |"
101
100
build_format_result = "| {:^8} | {:42} | {:^19} | {:^6.2f}s |"
@@ -590,11 +589,18 @@ def find_board():
590
589
def check_status (status , build_conf , boardKo , nb_build_conf ):
591
590
global nb_build_passed
592
591
global nb_build_failed
592
+ global nb_warnings
593
593
sketch_name = build_conf [idx_cmd ][- 1 ].name
594
594
595
595
if status [1 ] == 0 :
596
596
result = fsucc
597
597
nb_build_passed += 1
598
+ # Check warnings
599
+ logFile = build_conf [idx_log ] / f"{ sketch_name } .log"
600
+ for i , line in enumerate (open (logFile )):
601
+ if warning_pattern .search (line ):
602
+ nb_warnings += 1
603
+ print (f"Warning: { line } " )
598
604
elif status [1 ] == 1 :
599
605
# Check if failed due to a region overflowed
600
606
logFile = build_conf [idx_log ] / f"{ sketch_name } .log"
@@ -608,7 +614,11 @@ def check_status(status, build_conf, boardKo, nb_build_conf):
608
614
elif ld_pattern .search (line ):
609
615
# If one ld line is not for region overflowed --> failed
610
616
if overflow_pattern .search (line ) is None :
611
- error_found = True
617
+ if warning_pattern .search (line ):
618
+ nb_warnings += 1
619
+ print (f"Warning: { line } " )
620
+ else :
621
+ error_found = True
612
622
else :
613
623
overflow_found = True
614
624
if error_found :
@@ -692,6 +702,8 @@ def log_final_result():
692
702
sfail = f"{ nb_build_failed } failed ({ stat_failed } %)"
693
703
sskip = f"{ nb_build_skipped } skipped)"
694
704
f .write (f"{ ssucc } , { sfail } of { nb_build_total } builds ({ sskip } )\n " )
705
+ if nb_warnings :
706
+ f .write (f"Total warning to remove: { nb_warnings } \n " )
695
707
f .write (f"Ends { time .strftime ('%A %d %B %Y %H:%M:%S' )} \n " )
696
708
f .write (f"Duration: { duration } \n " )
697
709
f .write (f"Logs are available here:\n { output_dir } \n " )
@@ -702,6 +714,8 @@ def log_final_result():
702
714
sfail = f"{ nb_build_failed } { ffail } ({ stat_failed } %)"
703
715
sskip = f"{ nb_build_skipped } { fskip } "
704
716
print (f"Builds Summary: { ssucc } , { sfail } of { nb_build_total } builds ({ sskip } )" )
717
+ if nb_warnings :
718
+ print (f"Total warning to remove: { nb_warnings } " )
705
719
print (f"Duration: { duration } " )
706
720
print ("Logs are available here:" )
707
721
print (output_dir )
0 commit comments