Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions internal/arduino/sketch/profiles.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ type Profile struct {

// UsesSystemPlatform checks if this profile requires a system installed platform.
func (p *Profile) RequireSystemInstalledPlatform() bool {
if len(p.Platforms) == 0 {
return true
}
return p.Platforms[0].RequireSystemInstalledPlatform()
}

Expand Down
18 changes: 18 additions & 0 deletions internal/integrationtest/profiles/profiles_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -392,3 +392,21 @@ func TestProfileSetDefault(t *testing.T) {
require.Error(t, err)
require.Equal(t, "Cannot set inexistent_profile as default profile: Profile 'inexistent_profile' not found\n", string(stderr))
}

func TestProfileLoadingIssue3081(t *testing.T) {
// https://github.com/arduino/arduino-cli/issues/3081
env, cli := integrationtest.CreateArduinoCLIWithEnvironment(t)
defer env.CleanUp()

// Init the environment explicitly
_, _, err := cli.Run("core", "update-index")
require.NoError(t, err)
_, _, err = cli.Run("core", "install", "arduino:avr")
require.NoError(t, err)

// Compile problematic sketch
sk, err := paths.New("testdata", "Issue3081").Abs()
require.NoError(t, err)
_, _, err = cli.Run("compile", sk.String())
require.NoError(t, err)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
void setup() {}
void loop() {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
profiles:
garage:
fqbn: arduino:avr:uno
default_profile: garage