@@ -18,6 +18,7 @@ package compile_part_1_test
18
18
import (
19
19
"crypto/md5"
20
20
"encoding/hex"
21
+ "encoding/json"
21
22
"strings"
22
23
"testing"
23
24
@@ -294,3 +295,36 @@ func TestCompileWithCustomLibraries(t *testing.T) {
294
295
_ , _ , err = cli .Run ("compile" , "--libraries" , firstLib .String (), "--libraries" , secondLib .String (), "-b" , fqbn , sketchPath .String ())
295
296
require .NoError (t , err )
296
297
}
298
+
299
+ func TestCompileWithArchivesAndLongPaths (t * testing.T ) {
300
+ env , cli := integrationtest .CreateArduinoCLIWithEnvironment (t )
301
+ defer env .CleanUp ()
302
+
303
+ // Creates config with additional URL to install necessary core
304
+ url := "http://arduino.esp8266.com/stable/package_esp8266com_index.json"
305
+ _ , _ , err := cli .Run ("config" , "init" , "--dest-dir" , "." , "--additional-urls" , url )
306
+ require .NoError (t , err )
307
+
308
+ // Init the environment explicitly
309
+ _ , _ , err = cli .Run ("update" )
310
+ require .NoError (t , err )
311
+
312
+ // Install core to compile
313
+ _ ,
_ ,
err = cli .
Run (
"core" ,
"install" ,
"esp8266:[email protected] " )
314
+ require .NoError (t , err )
315
+
316
+ // Install test library
317
+ _ , _ , err = cli .Run ("lib" , "install" , "ArduinoIoTCloud" )
318
+ require .NoError (t , err )
319
+
320
+ stdout , _ , err := cli .Run ("lib" , "examples" , "ArduinoIoTCloud" , "--format" , "json" )
321
+ require .NoError (t , err )
322
+ var libOutput []map [string ]interface {}
323
+ err = json .Unmarshal (stdout , & libOutput )
324
+ require .NoError (t , err )
325
+ sketchPath := paths .New (libOutput [0 ]["library" ].(map [string ]interface {})["install_dir" ].(string ))
326
+ sketchPath = sketchPath .Join ("examples" , "ArduinoIoTCloud-Advanced" )
327
+
328
+ _ , _ , err = cli .Run ("compile" , "-b" , "esp8266:esp8266:huzzah" , sketchPath .String ())
329
+ require .NoError (t , err )
330
+ }
0 commit comments