Skip to content

Commit

Permalink
Migrated TestBuilderDidNotCatchLibsFromUnusedPlatforms to profiles_te…
Browse files Browse the repository at this point in the history
…st.go and deleted test_profiles.py
  • Loading branch information
MatteoPologruto committed Sep 13, 2022
1 parent 0bcb021 commit db6897a
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 33 deletions.
33 changes: 33 additions & 0 deletions internal/integrationtest/profiles/profiles_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,36 @@ func TestCompileWithProfiles(t *testing.T) {
_, _, err = cli.Run("compile", "-m", "avr2", sketchPath.String())
require.NoError(t, err)
}

func TestBuilderDidNotCatchLibsFromUnusedPlatforms(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 into the working directory
sketchName := "sketch_with_error_including_wire"
p, err := paths.Getwd()
require.NoError(t, err)
require.NotNil(t, p)
testSketch := p.Parent().Join("testdata", sketchName)
sketchPath := cli.SketchbookDir().Join(sketchName)
err = testSketch.CopyDirTo(sketchPath)
require.NoError(t, err)

// install two platforms with the Wire library bundled
_, _, err = cli.Run("core", "install", "arduino:avr")
require.NoError(t, err)
_, _, err = cli.Run("core", "install", "arduino:samd")
require.NoError(t, err)

// compile for AVR
stdout, stderr, err := cli.Run("compile", "-b", "arduino:avr:uno", sketchPath.String())
require.Error(t, err)

// check that the libary resolver did not take the SAMD bundled Wire library into account
require.NotContains(t, string(stdout), "samd")
require.NotContains(t, string(stderr), "samd")
}
33 changes: 0 additions & 33 deletions test/test_profiles.py

This file was deleted.

0 comments on commit db6897a

Please sign in to comment.