@@ -396,6 +396,39 @@ board_manager:
396
396
require .NotZero (t , exitCode )
397
397
}
398
398
399
+ func Test3rdPartyCoreIntegration (t * testing.T ) {
400
+ // override SetUp dirs
401
+ tmp := tmpDirOrDie ()
402
+ defer os .RemoveAll (tmp )
403
+ os .Setenv ("ARDUINO_SKETCHBOOK_DIR" , tmp )
404
+ currSketchbookDir = tmp
405
+
406
+ configFile := filepath .Join (currDataDir , "arduino-cli.yaml" )
407
+ err := ioutil .WriteFile (configFile , []byte (`
408
+ board_manager:
409
+ additional_urls:
410
+ - https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
411
+ ` ), os .FileMode (0644 ))
412
+ require .NoError (t , err , "writing dummy config " + configFile )
413
+
414
+ // Update index and install esp32:esp32
415
+ exitCode , _ := executeWithArgs ("--config-file" , configFile , "core" , "update-index" )
416
+ require .Zero (t , exitCode )
417
+ exitCode , d := executeWithArgs ("--config-file" , configFile , "core" , "install" , "esp32:esp32" )
418
+ require .Zero (t , exitCode )
419
+ require .Contains (t , string (d ), "installed" )
420
+
421
+ // Build a simple sketch and check if all artifacts are copied
422
+ tmpSketch := paths .New (currSketchbookDir ).Join ("Blink" )
423
+ err = paths .New ("testdata/Blink" ).CopyDirTo (tmpSketch )
424
+ require .NoError (t , err , "copying test sketch into temp dir" )
425
+ exitCode , d = executeWithArgs ("--config-file" , configFile , "compile" , "-b" , "esp32:esp32:esp32" , tmpSketch .String ())
426
+ require .Zero (t , exitCode )
427
+ require .True (t , tmpSketch .Join ("Blink.esp32.esp32.esp32.bin" ).Exist ())
428
+ require .True (t , tmpSketch .Join ("Blink.esp32.esp32.esp32.elf" ).Exist ())
429
+ require .True (t , tmpSketch .Join ("Blink.esp32.esp32.esp32.partitions.bin" ).Exist ()) // https://github.com/arduino/arduino-cli/issues/163
430
+ }
431
+
399
432
func TestCoreCommandsIntegration (t * testing.T ) {
400
433
// override SetUp dirs
401
434
tmp := tmpDirOrDie ()
0 commit comments