Skip to content

Commit cd5dcca

Browse files
Add test to verify that LoadSketchResponse contains the profiles
1 parent af46739 commit cd5dcca

File tree

3 files changed

+45
-0
lines changed

3 files changed

+45
-0
lines changed

Diff for: commands/sketch/load_test.go

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package sketch
2+
3+
import (
4+
"context"
5+
"testing"
6+
7+
"github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1"
8+
"github.com/stretchr/testify/require"
9+
)
10+
11+
func TestLoadSketchProfiles(t *testing.T) {
12+
loadResp, err := LoadSketch(context.Background(), &commands.LoadSketchRequest{
13+
SketchPath: "./testdata/sketch_with_profile",
14+
})
15+
require.NoError(t, err)
16+
require.Len(t, loadResp.GetProfiles(), 2)
17+
require.Equal(t, loadResp.GetDefaultProfile().GetName(), "nanorp")
18+
}
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
profiles:
2+
nanorp:
3+
fqbn: arduino:avr:uno
4+
platforms:
5+
- platform: arduino:mbed_nano (4.0.2)
6+
libraries:
7+
- ArduinoIoTCloud (1.0.2)
8+
- Arduino_ConnectionHandler (0.6.4)
9+
- TinyDHT sensor library (1.1.0)
10+
11+
another_profile_name:
12+
notes: testing the limit of the AVR platform, may be unstable
13+
fqbn: arduino:avr:uno
14+
platforms:
15+
- platform: arduino:avr (1.8.4)
16+
libraries:
17+
- VitconMQTT (1.0.1)
18+
- Arduino_ConnectionHandler (0.6.4)
19+
- TinyDHT sensor library (1.1.0)
20+
21+
default_profile: nanorp
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
void setup() {
3+
}
4+
5+
void loop() {
6+
}

0 commit comments

Comments
 (0)