@@ -776,3 +776,43 @@ func TestCoreListPlatformWithoutPlatformTxt(t *testing.T) {
776
776
requirejson .Query (t , stdout , ".[] | .id" , "\" some-packager:some-arch\" " )
777
777
requirejson .Query (t , stdout , ".[] | .name" , "\" some-packager-some-arch\" " )
778
778
}
779
+
780
+ func TestCoreWithMissingCustomBoardOptionsIsLoaded (t * testing.T ) {
781
+ env , cli := integrationtest .CreateArduinoCLIWithEnvironment (t )
782
+ defer env .CleanUp ()
783
+
784
+ // Install platform in Sketchbook hardware dir
785
+ testPlatformName := "platform_with_missing_custom_board_options"
786
+ platformInstallDir := cli .SketchbookDir ().Join ("hardware" , "arduino-beta-dev" )
787
+ require .NoError (t , platformInstallDir .MkdirAll ())
788
+ require .NoError (t , paths .New (".." , "testdata" , testPlatformName ).CopyDirTo (platformInstallDir .Join (testPlatformName )))
789
+
790
+ _ , _ , err := cli .Run ("update" )
791
+ require .NoError (t , err )
792
+
793
+ stdout , _ , err := cli .Run ("core" , "list" , "--format" , "json" )
794
+ require .NoError (t , err )
795
+ requirejson .Len (t , stdout , 1 )
796
+ // Verifies platform is loaded except excluding board with missing options
797
+ requirejson .Contains (t , stdout , `[
798
+ {
799
+ "id": "arduino-beta-dev:platform_with_missing_custom_board_options"
800
+ }
801
+ ]` )
802
+ requirejson .Query (t , stdout , ".[] | select(.id == \" arduino-beta-dev:platform_with_missing_custom_board_options\" ) | .boards | length" , "2" )
803
+ // Verify board with malformed options is not loaded
804
+ // while other board is loaded
805
+ requirejson .Contains (t , stdout , `[
806
+ {
807
+ "id": "arduino-beta-dev:platform_with_missing_custom_board_options",
808
+ "boards": [
809
+ {
810
+ "fqbn": "arduino-beta-dev:platform_with_missing_custom_board_options:nessuno"
811
+ },
812
+ {
813
+ "fqbn": "arduino-beta-dev:platform_with_missing_custom_board_options:altra"
814
+ }
815
+ ]
816
+ }
817
+ ]` )
818
+ }
0 commit comments