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