@@ -61,9 +61,8 @@ def example_name(sketch_name):
6161
6262TEST_MATRIX = {}
6363BOARD_SUMMARY = {}
64- EXPECTED_ERRORS = set ()
6564
66- def log_test (name , board , status , issues , job_link = None ):
65+ def log_test (name , board , exceptions , status , issues , job_link = None ):
6766 """
6867 Logs individual test results into the TEST_MATRIX dictionary.
6968 """
@@ -87,21 +86,20 @@ def log_test(name, board, status, issues, job_link=None):
8786 if status == WARNING :
8887 board_info ['warnings' ] += 1
8988 elif status == ERROR :
90- if ( board , name ) in EXPECTED_ERRORS :
89+ if any ( pattern . match ( name ) for pattern in exceptions ) :
9190 board_info ['expected-errors' ] += 1
9291 status = EXPECTED_ERROR
9392 else :
9493 board_info ['errors' ] += 1
9594
9695 board_info ['status' ] = max (board_info ['status' ], status )
9796
98- if name not in TEST_MATRIX :
99- TEST_MATRIX [name ] = {}
100-
101- TEST_MATRIX [name ][board ] = {
97+ sketch_tests = TEST_MATRIX .get (name , {})
98+ sketch_tests [board ] = {
10299 'status' : status ,
103100 'issues' : issues
104101 }
102+ TEST_MATRIX [name ] = sketch_tests
105103
106104# --- Main Logic ---
107105
@@ -127,12 +125,17 @@ def process_build_reports():
127125 subarch = board_data ['subarch' ]
128126
129127 # Get list of expected errors for this board/variant
128+ exceptions = []
130129 if os .path .exists (f"ArduinoCore-zephyr/variants/{ variant } /known_example_issues.txt" ):
130+ print (f"found ArduinoCore-zephyr/variants/{ variant } /known_example_issues.txt" )
131131 with open (f"ArduinoCore-zephyr/variants/{ variant } /known_example_issues.txt" , 'r' ) as f :
132132 for line in f :
133- sketch_name = line .split ('#' )[0 ].strip ()
134- if sketch_name :
135- EXPECTED_ERRORS .add ((board , sketch_name ))
133+ sketch_name_pattern = line .split ('#' )[0 ].strip ()
134+ if sketch_name_pattern :
135+ print (f"Adding expected error pattern: { sketch_name_pattern } " , file = sys .stderr )
136+ exceptions .append (re .compile (f"^(ArduinoCore-zephyr/)?{ sketch_name_pattern } " ))
137+ else :
138+ print (f"ArduinoCore-zephyr/variants/{ variant } /known_example_issues.txt not found" )
136139
137140 # Get raw data from report file
138141 REPORT_FILE = f"arduino-{ subarch } -{ board } .json"
@@ -165,7 +168,6 @@ def process_build_reports():
165168 # Replace long absolute paths with '...' for brevity.
166169 sketch_issues = [ re .sub (r'(/.+?)((/[^/]+){3}):' , r'...\2:' , issue ) for issue in issues ]
167170
168- # Logic to update counters and DETAILS string
169171 if not compilation_success :
170172 status = ERROR
171173 elif len (sketch_issues ): # Implies warnings/non-critical issues
0 commit comments