Skip to content

Commit e13561b

Browse files
Add TestCompileBuildPathInsideSketch to compile_test.go
1 parent 770c49a commit e13561b

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

Diff for: internal/integrationtest/compile_3/compile_test.go

+24
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,27 @@ func TestRuntimeToolPropertiesGeneration(t *testing.T) {
7272
require.True(t, res.GetPath("runtime.tools.avrdude.path").EquivalentTo(hardwareDir.Join("arduino", "tools", "avrdude", "6.3.0-arduino17")))
7373
}
7474
}
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

Comments
 (0)