@@ -22,6 +22,8 @@ import (
22
22
"github.com/arduino/arduino-cli/internal/integrationtest"
23
23
"github.com/arduino/go-paths-helper"
24
24
"github.com/stretchr/testify/require"
25
+ "gopkg.in/src-d/go-git.v4"
26
+ "gopkg.in/src-d/go-git.v4/plumbing"
25
27
)
26
28
27
29
func TestCompileSketchWithPdeExtesnion (t * testing.T ) {
@@ -250,3 +252,34 @@ func TestCompileUsingBoardsLocalTxt(t *testing.T) {
250
252
_ , _ , err = cli .Run ("compile" , "--clean" , "-b" , fqbn , sketchPath .String ())
251
253
require .NoError (t , err )
252
254
}
255
+
256
+ func TestCompileManuallyInstalledPlatform (t * testing.T ) {
257
+ env , cli := integrationtest .CreateArduinoCLIWithEnvironment (t )
258
+ defer env .CleanUp ()
259
+
260
+ _ , _ , err := cli .Run ("update" )
261
+ require .NoError (t , err )
262
+
263
+ sketchName := "CompileSketchManuallyInstalledPlatformUsingPlatformLocalTxt"
264
+ sketchPath := cli .SketchbookDir ().Join (sketchName )
265
+ fqbn := "arduino-beta-development:avr:uno"
266
+ _ , _ , err = cli .Run ("sketch" , "new" , sketchPath .String ())
267
+ require .NoError (t , err )
268
+
269
+ // Manually installs a core in sketchbooks hardware folder
270
+ gitUrl := "https://github.com/arduino/ArduinoCore-avr.git"
271
+ repoDir := cli .SketchbookDir ().Join ("hardware" , "arduino-beta-development" , "avr" )
272
+ _ , err = git .PlainClone (repoDir .String (), false , & git.CloneOptions {
273
+ URL : gitUrl ,
274
+ ReferenceName : plumbing .NewTagReferenceName ("1.8.3" ),
275
+ })
276
+ require .NoError (t , err )
277
+
278
+ // Installs also the same core via CLI so all the necessary tools are installed
279
+ _ ,
_ ,
err = cli .
Run (
"core" ,
"install" ,
"arduino:[email protected] " )
280
+ require .NoError (t , err )
281
+
282
+ // Verifies compilation works without issues
283
+ _ , _ , err = cli .Run ("compile" , "--clean" , "-b" , fqbn , sketchPath .String ())
284
+ require .NoError (t , err )
285
+ }
0 commit comments