We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7d1916d commit 87d2efaCopy full SHA for 87d2efa
internal/integrationtest/arduino-cli.go
@@ -126,6 +126,18 @@ func (cli *ArduinoCLI) SketchbookDir() *paths.Path {
126
return cli.sketchbookDir
127
}
128
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
138
+ return sketchPath
139
+}
140
+
141
// Run executes the given arduino-cli command and returns the output.
142
func (cli *ArduinoCLI) Run(args ...string) ([]byte, []byte, error) {
143
return cli.RunWithCustomEnv(cli.cliEnvVars, args...)
0 commit comments