File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -126,6 +126,18 @@ func (cli *ArduinoCLI) SketchbookDir() *paths.Path {
126126 return cli .sketchbookDir
127127}
128128
129+ // CopySketch copies a sketch inside the testing environment and returns its path
130+ func (cli * ArduinoCLI ) CopySketch (sketchName string ) * paths.Path {
131+ p , err := paths .Getwd ()
132+ cli .t .NoError (err )
133+ cli .t .NotNil (p )
134+ testSketch := p .Parent ().Join ("testdata" , sketchName )
135+ sketchPath := cli .SketchbookDir ().Join (sketchName )
136+ err = testSketch .CopyDirTo (sketchPath )
137+ cli .t .NoError (err )
138+ return sketchPath
139+ }
140+
129141// Run executes the given arduino-cli command and returns the output.
130142func (cli * ArduinoCLI ) Run (args ... string ) ([]byte , []byte , error ) {
131143 return cli .RunWithCustomEnv (cli .cliEnvVars , args ... )
You can’t perform that action at this time.
0 commit comments