@@ -259,3 +259,29 @@ func TestCompileWithInvalidUrl(t *testing.T) {
259
259
expectedIndexfile := cli .DataDir ().Join ("package_example_index.json" )
260
260
require .Contains (t , string (stderr ), "loading json index file " + expectedIndexfile .String ()+ ": open " + expectedIndexfile .String ()+ ":" )
261
261
}
262
+
263
+ func TestCompileWithCustomLibraries (t * testing.T ) {
264
+ env , cli := integrationtest .CreateArduinoCLIWithEnvironment (t )
265
+ defer env .CleanUp ()
266
+
267
+ // Creates config with additional URL to install necessary core
268
+ url := "http://arduino.esp8266.com/stable/package_esp8266com_index.json"
269
+ _ , _ , err := cli .Run ("config" , "init" , "--dest-dir" , "." , "--additional-urls" , url )
270
+ require .NoError (t , err )
271
+
272
+ // Init the environment explicitly
273
+ _ , _ , err = cli .Run ("update" )
274
+ require .NoError (t , err )
275
+
276
+ _ , _ , err = cli .Run ("core" , "install" , "esp8266:esp8266" )
277
+ require .NoError (t , err )
278
+
279
+ sketchName := "sketch_with_multiple_custom_libraries"
280
+ sketchPath := cli .CopySketch (sketchName )
281
+ fqbn := "esp8266:esp8266:nodemcu:xtal=80,vt=heap,eesz=4M1M,wipe=none,baud=115200"
282
+
283
+ firstLib := sketchPath .Join ("libraries1" )
284
+ secondLib := sketchPath .Join ("libraries2" )
285
+ _ , _ , err = cli .Run ("compile" , "--libraries" , firstLib .String (), "--libraries" , secondLib .String (), "-b" , fqbn , sketchPath .String ())
286
+ require .NoError (t , err )
287
+ }
0 commit comments