Skip to content

Commit

Permalink
Fixed test for legacy ctx.ToolsDirs -> BuiltInToolsDirs rename
Browse files Browse the repository at this point in the history
  • Loading branch information
cmaglie committed Sep 20, 2019
1 parent 7727b8d commit b677403
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 33 deletions.
6 changes: 3 additions & 3 deletions legacy/builder/test/builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ func TestBuilderBridgeRedBearLab(t *testing.T) {

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

buildPath := SetupBuildPath(t, ctx)
defer buildPath.RemoveAll()
Expand Down Expand Up @@ -277,7 +277,7 @@ func TestBuilderSketchNoFunctions(t *testing.T) {

ctx := prepareBuilderTestContext(t, paths.New("sketch_no_functions", "main.ino"), "RedBearLab:avr:blend")
ctx.HardwareDirs = append(ctx.HardwareDirs, paths.New("downloaded_board_manager_stuff"))
ctx.ToolsDirs = append(ctx.ToolsDirs, paths.New("downloaded_board_manager_stuff"))
ctx.BuiltInToolsDirs = append(ctx.BuiltInToolsDirs, paths.New("downloaded_board_manager_stuff"))

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

ctx := prepareBuilderTestContext(t, paths.New("sketch_with_backup_files", "sketch.ino"), "arduino:avr:uno")
ctx.HardwareDirs = append(ctx.HardwareDirs, paths.New("downloaded_board_manager_stuff"))
ctx.ToolsDirs = append(ctx.ToolsDirs, paths.New("downloaded_board_manager_stuff"))
ctx.BuiltInToolsDirs = append(ctx.BuiltInToolsDirs, paths.New("downloaded_board_manager_stuff"))

buildPath := SetupBuildPath(t, ctx)
defer buildPath.RemoveAll()
Expand Down
24 changes: 12 additions & 12 deletions legacy/builder/test/create_build_options_map_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import (
func TestCreateBuildOptionsMap(t *testing.T) {
ctx := &types.Context{
HardwareDirs: paths.NewPathList("hardware", "hardware2"),
ToolsDirs: paths.NewPathList("tools"),
BuiltInToolsDirs: paths.NewPathList("tools"),
OtherLibrariesDirs: paths.NewPathList("libraries"),
SketchLocation: paths.New("sketchLocation"),
FQBN: parseFQBN(t, "my:nice:fqbn"),
Expand All @@ -55,15 +55,15 @@ func TestCreateBuildOptionsMap(t *testing.T) {
err := create.Run(ctx)
NoError(t, err)

require.Equal(t, "{\n"+
" \"additionalFiles\": \"\",\n"+
" \"builtInLibrariesFolders\": \"\",\n"+
" \"customBuildProperties\": \"\",\n"+
" \"fqbn\": \"my:nice:fqbn\",\n"+
" \"hardwareFolders\": \"hardware,hardware2\",\n"+
" \"otherLibrariesFolders\": \"libraries\",\n"+
" \"runtime.ide.version\": \"ideVersion\",\n"+
" \"sketchLocation\": \"sketchLocation\",\n"+
" \"toolsFolders\": \"tools\"\n"+
"}", ctx.BuildOptionsJson)
require.Equal(t, `{
"additionalFiles": "",
"builtInLibrariesFolders": "",
"builtInToolsFolders": "tools",
"customBuildProperties": "",
"fqbn": "my:nice:fqbn",
"hardwareFolders": "hardware,hardware2",
"otherLibrariesFolders": "libraries",
"runtime.ide.version": "ideVersion",
"sketchLocation": "sketchLocation"
}`, ctx.BuildOptionsJson)
}
4 changes: 2 additions & 2 deletions legacy/builder/test/load_vid_pid_specific_properties_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func TestLoadVIDPIDSpecificPropertiesWhenNoVIDPIDAreProvided(t *testing.T) {

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

ctx := &types.Context{
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "hardware", "downloaded_hardware"),
ToolsDirs: paths.NewPathList("downloaded_tools", "./tools_builtin"),
BuiltInToolsDirs: paths.NewPathList("downloaded_tools", "./tools_builtin"),
SketchLocation: paths.New("sketch1", "sketch.ino"),
FQBN: parseFQBN(t, "arduino:avr:micro"),
ArduinoAPIVersion: "10600",
Expand Down
8 changes: 4 additions & 4 deletions legacy/builder/test/merge_sketch_with_bootloader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func TestMergeSketchWithBootloader(t *testing.T) {

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

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

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

ctx := &types.Context{
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "hardware", "downloaded_hardware", "user_hardware"),
ToolsDirs: paths.NewPathList("downloaded_tools"),
BuiltInToolsDirs: paths.NewPathList("downloaded_tools"),
BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"),
OtherLibrariesDirs: paths.NewPathList("libraries"),
SketchLocation: paths.New("sketch1", "sketch.ino"),
Expand Down
24 changes: 12 additions & 12 deletions legacy/builder/test/store_build_options_map_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import (
func TestStoreBuildOptionsMap(t *testing.T) {
ctx := &types.Context{
HardwareDirs: paths.NewPathList("hardware"),
ToolsDirs: paths.NewPathList("tools"),
BuiltInToolsDirs: paths.NewPathList("tools"),
BuiltInLibrariesDirs: paths.NewPathList("built-in libraries"),
OtherLibrariesDirs: paths.NewPathList("libraries"),
SketchLocation: paths.New("sketchLocation"),
Expand Down Expand Up @@ -73,15 +73,15 @@ func TestStoreBuildOptionsMap(t *testing.T) {
bytes, err := buildPath.Join(constants.BUILD_OPTIONS_FILE).ReadFile()
NoError(t, err)

require.Equal(t, "{\n"+
" \"additionalFiles\": \"\",\n"+
" \"builtInLibrariesFolders\": \"built-in libraries\",\n"+
" \"customBuildProperties\": \"custom=prop\",\n"+
" \"fqbn\": \"my:nice:fqbn\",\n"+
" \"hardwareFolders\": \"hardware\",\n"+
" \"otherLibrariesFolders\": \"libraries\",\n"+
" \"runtime.ide.version\": \"ideVersion\",\n"+
" \"sketchLocation\": \"sketchLocation\",\n"+
" \"toolsFolders\": \"tools\"\n"+
"}", string(bytes))
require.Equal(t, `{
"additionalFiles": "",
"builtInLibrariesFolders": "built-in libraries",
"builtInToolsFolders": "tools",
"customBuildProperties": "custom=prop",
"fqbn": "my:nice:fqbn",
"hardwareFolders": "hardware",
"otherLibrariesFolders": "libraries",
"runtime.ide.version": "ideVersion",
"sketchLocation": "sketchLocation"
}`, string(bytes))
}

0 comments on commit b677403

Please sign in to comment.