Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 7a5cf9d

Browse files
committed
Added tests
1 parent 8522850 commit 7a5cf9d

File tree

4 files changed

+51
-3
lines changed

4 files changed

+51
-3
lines changed

‎go.mod‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ require (
3737
go.bug.st/cleanup v1.0.0
3838
go.bug.st/downloader/v2 v2.2.0
3939
go.bug.st/relaxed-semver v0.12.0
40-
go.bug.st/testifyjson v1.1.1
40+
go.bug.st/testifyjson v1.2.0
4141
golang.org/x/term v0.22.0
4242
golang.org/x/text v0.16.0
4343
google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157

‎go.sum‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,8 @@ go.bug.st/relaxed-semver v0.12.0 h1:se8v3lTdAAFp68+/RS/0Y/nFdnpdzkP5ICY04SPau4E=
219219
go.bug.st/relaxed-semver v0.12.0/go.mod h1:Cpcbiig6Omwlq6bS7i3MQWiqS7W7HDd8CAnZFC40Cl0=
220220
go.bug.st/serial v1.6.1 h1:VSSWmUxlj1T/YlRo2J104Zv3wJFrjHIl/T3NeruWAHY=
221221
go.bug.st/serial v1.6.1/go.mod h1:UABfsluHAiaNI+La2iESysd9Vetq7VRdpxvjx7CmmOE=
222-
go.bug.st/testifyjson v1.1.1 h1:nHotIMK151LF3vYsU/b2RaoVaWCgrf2kvQeGNoZkGaA=
223-
go.bug.st/testifyjson v1.1.1/go.mod h1:nZyy2icFbv3OE3zW3mGVOnC/GhWgb93LRu+29n2tJlI=
222+
go.bug.st/testifyjson v1.2.0 h1:0pAfOUMVCOJ6bb9JcC4UmnACjxwxv2Ojb6Z9chaQBjg=
223+
go.bug.st/testifyjson v1.2.0/go.mod h1:nZyy2icFbv3OE3zW3mGVOnC/GhWgb93LRu+29n2tJlI=
224224
go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE=
225225
go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
226226
go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI=

‎internal/integrationtest/core/core_test.go‎

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1303,3 +1303,44 @@ func TestCoreHavingIncompatibleDepTools(t *testing.T) {
13031303
require.Contains(t, lines, []string{"incompatible_vendor:avr", "n/a", "Incompatible", "Boards"})
13041304
}
13051305
}
1306+
1307+
func TestReferencedCoreBuildAndRuntimeProperties(t *testing.T) {
1308+
env, cli := integrationtest.CreateArduinoCLIWithEnvironment(t)
1309+
defer env.CleanUp()
1310+
1311+
_, _, err := cli.Run("core", "install", "arduino:avr@1.8.6")
1312+
require.NoError(t, err)
1313+
1314+
testSketchbook, err := paths.New("testdata", "sketchbook_with_extended_platform").Abs()
1315+
require.NoError(t, err)
1316+
1317+
// Install custom platform
1318+
err = testSketchbook.Join("hardware").CopyDirTo(cli.SketchbookDir().Join("hardware"))
1319+
require.NoError(t, err)
1320+
1321+
// Determine some useful paths
1322+
boardPlatformPath := cli.SketchbookDir().Join("hardware", "test", "avr").String()
1323+
corePlatformPath := cli.DataDir().Join("packages", "arduino", "hardware", "avr", "1.8.6").String()
1324+
corePath := cli.DataDir().Join("packages", "arduino", "hardware", "avr", "1.8.6", "cores", "arduino").String()
1325+
1326+
// Check runtime variables are populated correctly
1327+
{
1328+
outJson, _, err := cli.Run("board", "details", "-b", "test:avr:test", "--show-properties", "--json")
1329+
require.NoError(t, err)
1330+
out := requirejson.Parse(t, outJson).Query(".build_properties")
1331+
out.ArrayMustContain(`"build.board.platform.path=` + boardPlatformPath + `"`)
1332+
out.ArrayMustContain(`"build.core.platform.path=` + corePlatformPath + `"`)
1333+
out.ArrayMustContain(`"build.core.path=` + corePath + `"`)
1334+
out.ArrayMustContain(`"runtime.platform.path=` + boardPlatformPath + `"`)
1335+
}
1336+
{
1337+
outJson, _, err := cli.Run("board", "details", "-b", "test:avr:test2", "--show-properties", "--json")
1338+
require.NoError(t, err)
1339+
out := requirejson.Parse(t, outJson).Query(".build_properties")
1340+
out.ArrayMustContain(`"build.board.platform.path=` + boardPlatformPath + `"`)
1341+
out.ArrayMustContain(`"build.core.platform.path=` + corePlatformPath + `"`)
1342+
out.ArrayMustContain(`"build.core.path=` + corePath + `"`)
1343+
// https://github.com/arduino/arduino-cli/issues/2616
1344+
out.ArrayMustContain(`"runtime.platform.path=` + corePlatformPath + `"`)
1345+
}
1346+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
test.name=Test Board
3+
test.build.core=arduino:arduino
4+
5+
test2.name=Test 2 Board
6+
test2.build.core=arduino:arduino
7+
test2.runtime.use_core_platform_path_for_runtime_platform_path=true

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /