Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add TestCompileWithDefaultProfile to integration tests
  • Loading branch information
MatteoPologruto committed Aug 21, 2023
commit 4d747c87cafebedab40192141cdf0df62802e7e1
22 changes: 22 additions & 0 deletions internal/integrationtest/profiles/profiles_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,25 @@ func TestBuilderDidNotCatchLibsFromUnusedPlatforms(t *testing.T) {
require.NotContains(t, string(stdout), "samd")
require.NotContains(t, string(stderr), "samd")
}

func TestCompileWithDefaultProfile(t *testing.T) {
env, cli := integrationtest.CreateArduinoCLIWithEnvironment(t)
defer env.CleanUp()

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

// copy sketch_with_profile into the working directory
sketchPath := cli.CopySketch("sketch_with_profile")

// compile using the default profile with its fqbn
stdout, _, err := cli.Run("compile", sketchPath.String())
require.NoError(t, err)
require.Contains(t, string(stdout), "arduino:avr")

// compile using a different fbqn -> should have priority over the one in the default profile
stdout, _, err = cli.Run("compile", "-b", "arduino:samd:mkr1000", sketchPath.String())
require.NoError(t, err)
require.Contains(t, string(stdout), "arduino:samd")
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,8 @@ profiles:
fqbn: arduino:avr:uno
platforms:
- platform: arduino:avr (1.8.5)
- platform: arduino:samd (1.8.13)
libraries:
- Arduino_JSON (0.1.0)

default_profile: avr2