@@ -526,7 +526,7 @@ func compileWithExportBinariesConfig(t *testing.T, env *integrationtest.Environm
526
526
defer cli .WorkingDir ().Join ("arduino-cli.yaml" ).Remove ()
527
527
528
528
// Test if arduino-cli config file written in the previous run has the `always_export_binaries` flag set.
529
- stdout , _ , err := cli .Run ("config" , "dump" , "--format" , "json" )
529
+ stdout , _ , err := cli .Run ("config" , "dump" , "--format" , "json" , "--config-file" , "arduino-cli.yaml" )
530
530
require .NoError (t , err )
531
531
requirejson .Contains (t , stdout , `
532
532
{
@@ -536,7 +536,7 @@ func compileWithExportBinariesConfig(t *testing.T, env *integrationtest.Environm
536
536
}` )
537
537
538
538
// Test compilation with export binaries env var set
539
- _ , _ , err = cli .Run ("compile" , "-b" , fqbn , sketchPath .String ())
539
+ _ , _ , err = cli .Run ("compile" , "-b" , fqbn , "--config-file" , "arduino-cli.yaml" , sketchPath .String ())
540
540
require .NoError (t , err )
541
541
require .DirExists (t , sketchPath .Join ("build" ).String ())
542
542
@@ -563,7 +563,7 @@ func compileWithInvalidUrl(t *testing.T, env *integrationtest.Environment, cli *
563
563
require .NoError (t , err )
564
564
defer cli .WorkingDir ().Join ("arduino-cli.yaml" ).Remove ()
565
565
566
- _ , stderr , err := cli .Run ("compile" , "-b" , fqbn , sketchPath .String ())
566
+ _ , stderr , err := cli .Run ("compile" , "-b" , fqbn , "--config-file" , "arduino-cli.yaml" , sketchPath .String ())
567
567
require .NoError (t , err )
568
568
require .Contains (t , string (stderr ), "Error initializing instance: Loading index file: loading json index file" )
569
569
expectedIndexfile := cli .DataDir ().Join ("package_example_index.json" )
@@ -813,10 +813,10 @@ func TestCompileWithCustomLibraries(t *testing.T) {
813
813
require .NoError (t , err )
814
814
815
815
// Init the environment explicitly
816
- _ , _ , err = cli .Run ("update" )
816
+ _ , _ , err = cli .Run ("update" , "--config-file" , "arduino-cli.yaml" )
817
817
require .NoError (t , err )
818
818
819
- _ , _ , err = cli .Run ("core" , "install" , "esp8266:esp8266" )
819
+ _ , _ , err = cli .Run ("core" , "install" , "esp8266:esp8266" , "--config-file" , "arduino-cli.yaml" )
820
820
require .NoError (t , err )
821
821
822
822
sketchName := "sketch_with_multiple_custom_libraries"
@@ -825,7 +825,12 @@ func TestCompileWithCustomLibraries(t *testing.T) {
825
825
826
826
firstLib := sketchPath .Join ("libraries1" )
827
827
secondLib := sketchPath .Join ("libraries2" )
828
- _ , _ , err = cli .Run ("compile" , "--libraries" , firstLib .String (), "--libraries" , secondLib .String (), "-b" , fqbn , sketchPath .String ())
828
+ _ , _ , err = cli .Run ("compile" , "--libraries" ,
829
+ firstLib .String (),
830
+ "--libraries" , secondLib .String (),
831
+ "-b" , fqbn ,
832
+ "--config-file" , "arduino-cli.yaml" ,
833
+ sketchPath .String ())
829
834
require .NoError (t , err )
830
835
}
831
836
@@ -839,26 +844,26 @@ func TestCompileWithArchivesAndLongPaths(t *testing.T) {
839
844
require .NoError (t , err )
840
845
841
846
// Init the environment explicitly
842
- _ , _ , err = cli .Run ("update" )
847
+ _ , _ , err = cli .Run ("update" , "--config-file" , "arduino-cli.yaml" )
843
848
require .NoError (t , err )
844
849
845
850
// Install core to compile
846
- _ ,
_ ,
err = cli .
Run (
"core" ,
"install" ,
"esp8266:[email protected] " )
851
+ _ ,
_ ,
err = cli .
Run (
"core" ,
"install" ,
"esp8266:[email protected] " , "--config-file" , "arduino-cli.yaml" )
847
852
require .NoError (t , err )
848
853
849
854
// Install test library
850
- _ , _ , err = cli .Run ("lib" , "install" , "ArduinoIoTCloud" )
855
+ _ , _ , err = cli .Run ("lib" , "install" , "ArduinoIoTCloud" , "--config-file" , "arduino-cli.yaml" )
851
856
require .NoError (t , err )
852
857
853
- stdout , _ , err := cli .Run ("lib" , "examples" , "ArduinoIoTCloud" , "--format" , "json" )
858
+ stdout , _ , err := cli .Run ("lib" , "examples" , "ArduinoIoTCloud" , "--format" , "json" , "--config-file" , "arduino-cli.yaml" )
854
859
require .NoError (t , err )
855
860
var libOutput []map [string ]interface {}
856
861
err = json .Unmarshal (stdout , & libOutput )
857
862
require .NoError (t , err )
858
863
sketchPath := paths .New (libOutput [0 ]["library" ].(map [string ]interface {})["install_dir" ].(string ))
859
864
sketchPath = sketchPath .Join ("examples" , "ArduinoIoTCloud-Advanced" )
860
865
861
- _ , _ , err = cli .Run ("compile" , "-b" , "esp8266:esp8266:huzzah" , sketchPath .String ())
866
+ _ , _ , err = cli .Run ("compile" , "-b" , "esp8266:esp8266:huzzah" , sketchPath .String (), "--config-file" , "arduino-cli.yaml" )
862
867
require .NoError (t , err )
863
868
}
864
869
@@ -908,16 +913,19 @@ func TestCompileWithFullyPrecompiledLibrary(t *testing.T) {
908
913
// https://arduino.github.io/arduino-cli/latest/library-specification/#precompiled-binaries
909
914
wd , err := paths .Getwd ()
910
915
require .NoError (t , err )
911
- _ , _ , err = cli .Run ("lib" , "install" , "--zip-path" , wd .Parent ().Join ("testdata" , "Arduino_TensorFlowLite-2.1.0-ALPHA-precompiled.zip" ).String ())
916
+ _ , _ , err = cli .Run ("lib" , "install" ,
917
+ "--zip-path" , wd .Parent ().Join ("testdata" , "Arduino_TensorFlowLite-2.1.0-ALPHA-precompiled.zip" ).String (),
918
+ "--config-file" , "arduino-cli.yaml" ,
919
+ )
912
920
require .NoError (t , err )
913
921
sketchFolder := cli .SketchbookDir ().Join ("libraries" , "Arduino_TensorFlowLite" , "examples" , "hello_world" )
914
922
915
923
// Install example dependency
916
- _ , _ , err = cli .Run ("lib" , "install" , "Arduino_LSM9DS1" )
924
+ _ , _ , err = cli .Run ("lib" , "install" , "Arduino_LSM9DS1" , "--config-file" , "arduino-cli.yaml" )
917
925
require .NoError (t , err )
918
926
919
927
// Compile and verify dependencies detection for fully precompiled library is skipped
920
- stdout , _ , err := cli .Run ("compile" , "-b" , fqbn , sketchFolder .String (), "-v" )
928
+ stdout , _ , err := cli .Run ("compile" , "-b" , fqbn , "--config-file" , "arduino-cli.yaml" , sketchFolder .String (), "-v" )
921
929
require .NoError (t , err )
922
930
require .Contains (t , string (stdout ), "Skipping dependencies detection for precompiled library Arduino_TensorFlowLite" )
923
931
}
0 commit comments