@@ -72,3 +72,27 @@ func TestRuntimeToolPropertiesGeneration(t *testing.T) {
72
72
require .True (t , res .GetPath ("runtime.tools.avrdude.path" ).EquivalentTo (hardwareDir .Join ("arduino" , "tools" , "avrdude" , "6.3.0-arduino17" )))
73
73
}
74
74
}
75
+
76
+ func TestCompileBuildPathInsideSketch (t * testing.T ) {
77
+ env , cli := integrationtest .CreateArduinoCLIWithEnvironment (t )
78
+ defer env .CleanUp ()
79
+
80
+ _ , _ , err := cli .Run ("core" , "update-index" )
81
+ require .NoError (t , err )
82
+
83
+ _ , _ , err = cli .Run ("core" , "install" , "arduino:avr" )
84
+ require .NoError (t , err )
85
+
86
+ sketch := "sketchSimple"
87
+ _ , _ , err = cli .Run ("sketch" , "new" , sketch )
88
+ require .NoError (t , err )
89
+
90
+ cli .SetWorkingDir (cli .WorkingDir ().Join (sketch ))
91
+ // Compile the sketch creating the build directory inside the sketch directory
92
+ _ , _ , err = cli .Run ("compile" , "-b" , "arduino:avr:mega" , "--build-path" , "build-mega" )
93
+ require .NoError (t , err )
94
+
95
+ // Compile again using the same build path
96
+ _ , _ , err = cli .Run ("compile" , "-b" , "arduino:avr:mega" , "--build-path" , "build-mega" )
97
+ require .NoError (t , err )
98
+ }
0 commit comments