-
-
Notifications
You must be signed in to change notification settings - Fork 381
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[skip-changelog] Add profiles to
LoadSketchResponse
(#2264)
* Add informations regarding profiles to LoadSketchResponse * Load profiles when LoadSketch is called * Add test to verify that LoadSketchResponse contains the profiles
- Loading branch information
1 parent
38479dc
commit 086b77a
Showing
6 changed files
with
726 additions
and
534 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// This file is part of arduino-cli. | ||
// | ||
// Copyright 2023 ARDUINO SA (http://www.arduino.cc/) | ||
// | ||
// This software is released under the GNU General Public License version 3, | ||
// which covers the main part of arduino-cli. | ||
// The terms of this license can be found at: | ||
// https://www.gnu.org/licenses/gpl-3.0.en.html | ||
// | ||
// You can be released from the requirements of the above licenses by purchasing | ||
// a commercial license. Buying such a license is mandatory if you want to | ||
// modify or otherwise use the software for commercial activities involving the | ||
// Arduino software without disclosing the source code of your own applications. | ||
// To purchase a commercial license, send an email to [email protected]. | ||
|
||
package sketch | ||
|
||
import ( | ||
"context" | ||
"testing" | ||
|
||
"github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestLoadSketchProfiles(t *testing.T) { | ||
loadResp, err := LoadSketch(context.Background(), &commands.LoadSketchRequest{ | ||
SketchPath: "./testdata/sketch_with_profile", | ||
}) | ||
require.NoError(t, err) | ||
require.Len(t, loadResp.GetProfiles(), 2) | ||
require.Equal(t, loadResp.GetDefaultProfile().GetName(), "nanorp") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
profiles: | ||
nanorp: | ||
fqbn: arduino:avr:uno | ||
platforms: | ||
- platform: arduino:mbed_nano (4.0.2) | ||
libraries: | ||
- ArduinoIoTCloud (1.0.2) | ||
- Arduino_ConnectionHandler (0.6.4) | ||
- TinyDHT sensor library (1.1.0) | ||
|
||
another_profile_name: | ||
notes: testing the limit of the AVR platform, may be unstable | ||
fqbn: arduino:avr:uno | ||
platforms: | ||
- platform: arduino:avr (1.8.4) | ||
libraries: | ||
- VitconMQTT (1.0.1) | ||
- Arduino_ConnectionHandler (0.6.4) | ||
- TinyDHT sensor library (1.1.0) | ||
|
||
default_profile: nanorp |
6 changes: 6 additions & 0 deletions
6
commands/sketch/testdata/sketch_with_profile/sketch_with_profile.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
void setup() { | ||
} | ||
|
||
void loop() { | ||
} |
Oops, something went wrong.