Skip to content

Commit 35b7cb4

Browse files
Migrated TestBuilderDidNotCatchLibsFromUnusedPlatforms to profiles_test.go and deleted test_profiles.py
1 parent 3d65aea commit 35b7cb4

File tree

3 files changed

+36
-33
lines changed

3 files changed

+36
-33
lines changed

Diff for: internal/integrationtest/profiles/profiles_test.go

+33
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,36 @@ func TestCompileWithProfiles(t *testing.T) {
5151
_, _, err = cli.Run("compile", "-m", "avr2", sketchPath.String())
5252
require.NoError(t, err)
5353
}
54+
55+
func TestBuilderDidNotCatchLibsFromUnusedPlatforms(t *testing.T) {
56+
env, cli := integrationtest.CreateArduinoCLIWithEnvironment(t)
57+
defer env.CleanUp()
58+
59+
// Init the environment explicitly
60+
_, _, err := cli.Run("core", "update-index")
61+
require.NoError(t, err)
62+
63+
// copy sketch into the working directory
64+
sketchName := "sketch_with_error_including_wire"
65+
p, err := paths.Getwd()
66+
require.NoError(t, err)
67+
require.NotNil(t, p)
68+
testSketch := p.Parent().Join("testdata", sketchName)
69+
sketchPath := cli.SketchbookDir().Join(sketchName)
70+
err = testSketch.CopyDirTo(sketchPath)
71+
require.NoError(t, err)
72+
73+
// install two platforms with the Wire library bundled
74+
_, _, err = cli.Run("core", "install", "arduino:avr")
75+
require.NoError(t, err)
76+
_, _, err = cli.Run("core", "install", "arduino:samd")
77+
require.NoError(t, err)
78+
79+
// compile for AVR
80+
stdout, stderr, err := cli.Run("compile", "-b", "arduino:avr:uno", sketchPath.String())
81+
require.Error(t, err)
82+
83+
// check that the libary resolver did not take the SAMD bundled Wire library into account
84+
require.NotContains(t, string(stdout), "samd")
85+
require.NotContains(t, string(stderr), "samd")
86+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#include <Wire.h>
2+
3+
this sketch has syntax errors

Diff for: test/test_profiles.py

-33
This file was deleted.

0 commit comments

Comments
 (0)