Skip to content

Commit dd9d1d7

Browse files
committed
Fixed test for legacy ctx.ToolsDirs -> BuiltInToolsDirs rename
1 parent 4c8f09c commit dd9d1d7

5 files changed

+33
-33
lines changed

Diff for: legacy/builder/test/builder_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ func TestBuilderBridgeRedBearLab(t *testing.T) {
242242

243243
ctx := prepareBuilderTestContext(t, paths.New("downloaded_libraries", "Bridge", "examples", "Bridge", "Bridge.ino"), "RedBearLab:avr:blend")
244244
ctx.HardwareDirs = append(ctx.HardwareDirs, paths.New("downloaded_board_manager_stuff"))
245-
ctx.ToolsDirs = append(ctx.ToolsDirs, paths.New("downloaded_board_manager_stuff"))
245+
ctx.BuiltInToolsDirs = append(ctx.BuiltInToolsDirs, paths.New("downloaded_board_manager_stuff"))
246246

247247
buildPath := SetupBuildPath(t, ctx)
248248
defer buildPath.RemoveAll()
@@ -277,7 +277,7 @@ func TestBuilderSketchNoFunctions(t *testing.T) {
277277

278278
ctx := prepareBuilderTestContext(t, paths.New("sketch_no_functions", "main.ino"), "RedBearLab:avr:blend")
279279
ctx.HardwareDirs = append(ctx.HardwareDirs, paths.New("downloaded_board_manager_stuff"))
280-
ctx.ToolsDirs = append(ctx.ToolsDirs, paths.New("downloaded_board_manager_stuff"))
280+
ctx.BuiltInToolsDirs = append(ctx.BuiltInToolsDirs, paths.New("downloaded_board_manager_stuff"))
281281

282282
buildPath := SetupBuildPath(t, ctx)
283283
defer buildPath.RemoveAll()
@@ -293,7 +293,7 @@ func TestBuilderSketchWithBackup(t *testing.T) {
293293

294294
ctx := prepareBuilderTestContext(t, paths.New("sketch_with_backup_files", "sketch.ino"), "arduino:avr:uno")
295295
ctx.HardwareDirs = append(ctx.HardwareDirs, paths.New("downloaded_board_manager_stuff"))
296-
ctx.ToolsDirs = append(ctx.ToolsDirs, paths.New("downloaded_board_manager_stuff"))
296+
ctx.BuiltInToolsDirs = append(ctx.BuiltInToolsDirs, paths.New("downloaded_board_manager_stuff"))
297297

298298
buildPath := SetupBuildPath(t, ctx)
299299
defer buildPath.RemoveAll()

Diff for: legacy/builder/test/create_build_options_map_test.go

+12-12
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ import (
4141
func TestCreateBuildOptionsMap(t *testing.T) {
4242
ctx := &types.Context{
4343
HardwareDirs: paths.NewPathList("hardware", "hardware2"),
44-
ToolsDirs: paths.NewPathList("tools"),
44+
BuiltInToolsDirs: paths.NewPathList("tools"),
4545
OtherLibrariesDirs: paths.NewPathList("libraries"),
4646
SketchLocation: paths.New("sketchLocation"),
4747
FQBN: parseFQBN(t, "my:nice:fqbn"),
@@ -55,15 +55,15 @@ func TestCreateBuildOptionsMap(t *testing.T) {
5555
err := create.Run(ctx)
5656
NoError(t, err)
5757

58-
require.Equal(t, "{\n"+
59-
" \"additionalFiles\": \"\",\n"+
60-
" \"builtInLibrariesFolders\": \"\",\n"+
61-
" \"customBuildProperties\": \"\",\n"+
62-
" \"fqbn\": \"my:nice:fqbn\",\n"+
63-
" \"hardwareFolders\": \"hardware,hardware2\",\n"+
64-
" \"otherLibrariesFolders\": \"libraries\",\n"+
65-
" \"runtime.ide.version\": \"ideVersion\",\n"+
66-
" \"sketchLocation\": \"sketchLocation\",\n"+
67-
" \"toolsFolders\": \"tools\"\n"+
68-
"}", ctx.BuildOptionsJson)
58+
require.Equal(t, `{
59+
"additionalFiles": "",
60+
"builtInLibrariesFolders": "",
61+
"builtInToolsFolders": "tools",
62+
"customBuildProperties": "",
63+
"fqbn": "my:nice:fqbn",
64+
"hardwareFolders": "hardware,hardware2",
65+
"otherLibrariesFolders": "libraries",
66+
"runtime.ide.version": "ideVersion",
67+
"sketchLocation": "sketchLocation"
68+
}`, ctx.BuildOptionsJson)
6969
}

Diff for: legacy/builder/test/load_vid_pid_specific_properties_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func TestLoadVIDPIDSpecificPropertiesWhenNoVIDPIDAreProvided(t *testing.T) {
4444

4545
ctx := &types.Context{
4646
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "hardware", "downloaded_hardware"),
47-
ToolsDirs: paths.NewPathList("downloaded_tools", "./tools_builtin"),
47+
BuiltInToolsDirs: paths.NewPathList("downloaded_tools", "./tools_builtin"),
4848
SketchLocation: paths.New("sketch1", "sketch.ino"),
4949
FQBN: parseFQBN(t, "arduino:avr:micro"),
5050
ArduinoAPIVersion: "10600",
@@ -74,7 +74,7 @@ func TestLoadVIDPIDSpecificProperties(t *testing.T) {
7474

7575
ctx := &types.Context{
7676
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "hardware", "downloaded_hardware"),
77-
ToolsDirs: paths.NewPathList("downloaded_tools", "./tools_builtin"),
77+
BuiltInToolsDirs: paths.NewPathList("downloaded_tools", "./tools_builtin"),
7878
SketchLocation: paths.New("sketch1", "sketch.ino"),
7979
FQBN: parseFQBN(t, "arduino:avr:micro"),
8080
ArduinoAPIVersion: "10600",

Diff for: legacy/builder/test/merge_sketch_with_bootloader_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func TestMergeSketchWithBootloader(t *testing.T) {
4646

4747
ctx := &types.Context{
4848
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "hardware", "downloaded_hardware"),
49-
ToolsDirs: paths.NewPathList("downloaded_tools"),
49+
BuiltInToolsDirs: paths.NewPathList("downloaded_tools"),
5050
BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"),
5151
OtherLibrariesDirs: paths.NewPathList("libraries"),
5252
SketchLocation: paths.New("sketch1", "sketch.ino"),
@@ -88,7 +88,7 @@ func TestMergeSketchWithBootloaderSketchInBuildPath(t *testing.T) {
8888

8989
ctx := &types.Context{
9090
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "hardware", "downloaded_hardware"),
91-
ToolsDirs: paths.NewPathList("downloaded_tools"),
91+
BuiltInToolsDirs: paths.NewPathList("downloaded_tools"),
9292
BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"),
9393
OtherLibrariesDirs: paths.NewPathList("libraries"),
9494
SketchLocation: paths.New("sketch1", "sketch.ino"),
@@ -130,7 +130,7 @@ func TestMergeSketchWithBootloaderWhenNoBootloaderAvailable(t *testing.T) {
130130

131131
ctx := &types.Context{
132132
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "hardware", "downloaded_hardware"),
133-
ToolsDirs: paths.NewPathList("downloaded_tools"),
133+
BuiltInToolsDirs: paths.NewPathList("downloaded_tools"),
134134
BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"),
135135
OtherLibrariesDirs: paths.NewPathList("libraries"),
136136
SketchLocation: paths.New("sketch1", "sketch.ino"),
@@ -168,7 +168,7 @@ func TestMergeSketchWithBootloaderPathIsParameterized(t *testing.T) {
168168

169169
ctx := &types.Context{
170170
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "hardware", "downloaded_hardware", "user_hardware"),
171-
ToolsDirs: paths.NewPathList("downloaded_tools"),
171+
BuiltInToolsDirs: paths.NewPathList("downloaded_tools"),
172172
BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"),
173173
OtherLibrariesDirs: paths.NewPathList("libraries"),
174174
SketchLocation: paths.New("sketch1", "sketch.ino"),

Diff for: legacy/builder/test/store_build_options_map_test.go

+12-12
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ import (
4242
func TestStoreBuildOptionsMap(t *testing.T) {
4343
ctx := &types.Context{
4444
HardwareDirs: paths.NewPathList("hardware"),
45-
ToolsDirs: paths.NewPathList("tools"),
45+
BuiltInToolsDirs: paths.NewPathList("tools"),
4646
BuiltInLibrariesDirs: paths.NewPathList("built-in libraries"),
4747
OtherLibrariesDirs: paths.NewPathList("libraries"),
4848
SketchLocation: paths.New("sketchLocation"),
@@ -73,15 +73,15 @@ func TestStoreBuildOptionsMap(t *testing.T) {
7373
bytes, err := buildPath.Join(constants.BUILD_OPTIONS_FILE).ReadFile()
7474
NoError(t, err)
7575

76-
require.Equal(t, "{\n"+
77-
" \"additionalFiles\": \"\",\n"+
78-
" \"builtInLibrariesFolders\": \"built-in libraries\",\n"+
79-
" \"customBuildProperties\": \"custom=prop\",\n"+
80-
" \"fqbn\": \"my:nice:fqbn\",\n"+
81-
" \"hardwareFolders\": \"hardware\",\n"+
82-
" \"otherLibrariesFolders\": \"libraries\",\n"+
83-
" \"runtime.ide.version\": \"ideVersion\",\n"+
84-
" \"sketchLocation\": \"sketchLocation\",\n"+
85-
" \"toolsFolders\": \"tools\"\n"+
86-
"}", string(bytes))
76+
require.Equal(t, `{
77+
"additionalFiles": "",
78+
"builtInLibrariesFolders": "built-in libraries",
79+
"builtInToolsFolders": "tools",
80+
"customBuildProperties": "custom=prop",
81+
"fqbn": "my:nice:fqbn",
82+
"hardwareFolders": "hardware",
83+
"otherLibrariesFolders": "libraries",
84+
"runtime.ide.version": "ideVersion",
85+
"sketchLocation": "sketchLocation"
86+
}`, string(bytes))
8787
}

0 commit comments

Comments
 (0)