@@ -260,7 +260,7 @@ def check_duplicate_markers(test_mode=False):
260
260
return errors
261
261
262
262
263
- def target_has_arduino_form_factor (target_name ):
263
+ def target_has_form_factor (target_name , form_factor ):
264
264
"""Check if the target has the Arduino form factor."""
265
265
mbed_os_root = pathlib .Path (__file__ ).absolute ().parents [3 ]
266
266
@@ -272,7 +272,7 @@ def target_has_arduino_form_factor(target_name):
272
272
if target_name in target_data :
273
273
if "supported_form_factors" in target_data [target_name ]:
274
274
form_factors = target_data [target_name ]["supported_form_factors" ]
275
- if "ARDUINO_UNO" in form_factors :
275
+ if form_factor in form_factors :
276
276
return True
277
277
278
278
return False
@@ -464,6 +464,13 @@ def legacy_uart_check(pin_name_dict):
464
464
return invalid_items
465
465
466
466
467
+ def legacy_arduino_uno_check (arduino_form_factor ):
468
+ invalid_items = []
469
+ if arduino_form_factor == True :
470
+ message = "ARDUINO form factor is deprecated, should be replaced by ARDUINO_UNO"
471
+ invalid_items .append ({"key" : "" , "val" : "" , "message" : message })
472
+ return invalid_items
473
+
467
474
def print_summary (report ):
468
475
targets = set ([case ["platform_name" ] for case in report ])
469
476
@@ -690,6 +697,12 @@ def has_passed_all_test_cases(report):
690
697
"case_function" : legacy_uart_check ,
691
698
"case_input" : "content" ,
692
699
},
700
+ {
701
+ "suite_name" : "generic" ,
702
+ "case_name" : "arduino_formfactor" ,
703
+ "case_function" : legacy_arduino_uno_check ,
704
+ "case_input" : "arduino_form_factor" ,
705
+ },
693
706
{
694
707
"suite_name" : "arduino_uno" ,
695
708
"case_name" : "duplicate" ,
@@ -740,21 +753,27 @@ def validate_pin_names(args):
740
753
741
754
pin_name_dict = pin_name_to_dict (pin_name_content )
742
755
743
- arduino_support = target_has_arduino_form_factor (target )
756
+ arduino_uno_support = target_has_form_factor (target , "ARDUINO_UNO" )
757
+
758
+ arduino_support = target_has_form_factor (target , "ARDUINO" )
744
759
745
760
for case in test_cases :
746
761
if suites :
747
762
if case ["suite_name" ] not in suites :
748
763
continue
749
764
else :
750
- if not arduino_support and case ["suite_name" ] == "arduino_uno" :
765
+ if not arduino_uno_support and case ["suite_name" ] == "arduino_uno" :
766
+ continue
767
+ if not arduino_uno_support and not arduino_support and case ["case_name" ] == "arduino_formfactor" :
751
768
continue
752
769
770
+
753
771
if case ["case_input" ] == "dict" :
754
772
case_input = pin_name_dict
755
773
elif case ["case_input" ] == "content" :
756
774
case_input = pin_name_content
757
-
775
+ elif case ["case_input" ] == "arduino_form_factor" :
776
+ case_input = arduino_support
758
777
case_output = case ["case_function" ](case_input )
759
778
760
779
case_result = "FAILED" if case_output else "PASSED"
0 commit comments