File tree 1 file changed +12
-0
lines changed
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 {
126
126
return cli .sketchbookDir
127
127
}
128
128
129
+ // CopySketch copies a sketch inside the testing environment and returns its path
130
+ func (cli * ArduinoCLI ) CopySketch (t * testing.T , sketchName string ) * paths.Path {
131
+ p , err := paths .Getwd ()
132
+ require .NoError (t , err )
133
+ require .NotNil (t , p )
134
+ testSketch := p .Parent ().Join ("testdata" , sketchName )
135
+ sketchPath := cli .SketchbookDir ().Join (sketchName )
136
+ err = testSketch .CopyDirTo (sketchPath )
137
+ require .NoError (t , err )
138
+ return sketchPath
139
+ }
140
+
129
141
// Run executes the given arduino-cli command and returns the output.
130
142
func (cli * ArduinoCLI ) Run (args ... string ) ([]byte , []byte , error ) {
131
143
return cli .RunWithCustomEnv (cli .cliEnvVars , args ... )
You can’t perform that action at this time.
0 commit comments