@@ -791,3 +791,43 @@ func TestCoreListPlatformWithoutPlatformTxt(t *testing.T) {
791791 requirejson .Query (t , stdout , ".[] | .id" , "\" some-packager:some-arch\" " )
792792 requirejson .Query (t , stdout , ".[] | .name" , "\" some-packager-some-arch\" " )
793793}
794+
795+ func TestCoreWithMissingCustomBoardOptionsIsLoaded (t * testing.T ) {
796+ env , cli := integrationtest .CreateArduinoCLIWithEnvironment (t )
797+ defer env .CleanUp ()
798+
799+ // Install platform in Sketchbook hardware dir
800+ testPlatformName := "platform_with_missing_custom_board_options"
801+ platformInstallDir := cli .SketchbookDir ().Join ("hardware" , "arduino-beta-dev" )
802+ require .NoError (t , platformInstallDir .MkdirAll ())
803+ require .NoError (t , paths .New (".." , "testdata" , testPlatformName ).CopyDirTo (platformInstallDir .Join (testPlatformName )))
804+
805+ _ , _ , err := cli .Run ("update" )
806+ require .NoError (t , err )
807+
808+ stdout , _ , err := cli .Run ("core" , "list" , "--format" , "json" )
809+ require .NoError (t , err )
810+ requirejson .Len (t , stdout , 1 )
811+ // Verifies platform is loaded except excluding board with missing options
812+ requirejson .Contains (t , stdout , `[
813+ {
814+ "id": "arduino-beta-dev:platform_with_missing_custom_board_options"
815+ }
816+ ]` )
817+ requirejson .Query (t , stdout , ".[] | select(.id == \" arduino-beta-dev:platform_with_missing_custom_board_options\" ) | .boards | length" , "2" )
818+ // Verify board with malformed options is not loaded
819+ // while other board is loaded
820+ requirejson .Contains (t , stdout , `[
821+ {
822+ "id": "arduino-beta-dev:platform_with_missing_custom_board_options",
823+ "boards": [
824+ {
825+ "fqbn": "arduino-beta-dev:platform_with_missing_custom_board_options:nessuno"
826+ },
827+ {
828+ "fqbn": "arduino-beta-dev:platform_with_missing_custom_board_options:altra"
829+ }
830+ ]
831+ }
832+ ]` )
833+ }
0 commit comments