Skip to content

Commit

Permalink
Add TestCompileWithDefaultProfile to integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MatteoPologruto committed Aug 21, 2023
1 parent bc49faf commit 90dd888
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
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

0 comments on commit 90dd888

Please sign in to comment.