@@ -69,3 +69,25 @@ func TestBuilderDidNotCatchLibsFromUnusedPlatforms(t *testing.T) {
69
69
require .NotContains (t , string (stdout ), "samd" )
70
70
require .NotContains (t , string (stderr ), "samd" )
71
71
}
72
+
73
+ func TestCompileWithDefaultProfile (t * testing.T ) {
74
+ env , cli := integrationtest .CreateArduinoCLIWithEnvironment (t )
75
+ defer env .CleanUp ()
76
+
77
+ // Init the environment explicitly
78
+ _ , _ , err := cli .Run ("core" , "update-index" )
79
+ require .NoError (t , err )
80
+
81
+ // copy sketch_with_profile into the working directory
82
+ sketchPath := cli .CopySketch ("sketch_with_profile" )
83
+
84
+ // compile using the default profile with its fqbn
85
+ stdout , _ , err := cli .Run ("compile" , sketchPath .String ())
86
+ require .NoError (t , err )
87
+ require .Contains (t , string (stdout ), "arduino:avr" )
88
+
89
+ // compile using a different fbqn -> should have priority over the one in the default profile
90
+ stdout , _ , err = cli .Run ("compile" , "-b" , "arduino:samd:mkr1000" , sketchPath .String ())
91
+ require .NoError (t , err )
92
+ require .Contains (t , string (stdout ), "arduino:samd" )
93
+ }
0 commit comments