Unverified Commit 0e6bb9ee authored by Silvano Cerza's avatar Silvano Cerza Committed by GitHub

[skip changelog] Fix platform loading legacy tests (#1180)

* [skip changelog] Fix platform loading legacy tests

* [skip changelog] Moved local.txt files used for testing
parent 7e1ff323
...@@ -379,9 +379,9 @@ Arduino IDE. ...@@ -379,9 +379,9 @@ Arduino IDE.
## platform.local.txt ## platform.local.txt
Introduced in Arduino IDE 1.5.7. This file can be used to override properties defined in platform.txt or define new Introduced in Arduino IDE 1.5.7. This file can be used to override properties defined in `platform.txt` or define new
properties without modifying platform.txt (e.g. when platform.txt is tracked by a version control system). It should be properties without modifying `platform.txt` (e.g. when `platform.txt` is tracked by a version control system). It must
placed in the same folder as the platform.txt it supplements. be placed in the same folder as the `platform.txt` it supplements.
## boards.txt ## boards.txt
...@@ -978,8 +978,8 @@ actual Arduino CLI code, the "board platform" is called `targetPlatform`, the "c ...@@ -978,8 +978,8 @@ actual Arduino CLI code, the "board platform" is called `targetPlatform`, the "c
## boards.local.txt ## boards.local.txt
Introduced in Arduino IDE 1.6.6. This file can be used to override properties defined in boards.txt or define new Introduced in Arduino IDE 1.6.6. This file can be used to override properties defined in `boards.txt` or define new
properties without modifying boards.txt. properties without modifying `boards.txt`. It must be placed in the same folder as the `boards.txt` it supplements.
## Platform bundled libraries ## Platform bundled libraries
......
...@@ -36,7 +36,7 @@ func TestAddBuildBoardPropertyIfMissing(t *testing.T) { ...@@ -36,7 +36,7 @@ func TestAddBuildBoardPropertyIfMissing(t *testing.T) {
DownloadCoresAndToolsAndLibraries(t) DownloadCoresAndToolsAndLibraries(t)
ctx := &types.Context{ ctx := &types.Context{
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "hardware", "downloaded_hardware", "user_hardware"), HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware", "user_hardware"),
FQBN: parseFQBN(t, "my_avr_platform:avr:mymega"), FQBN: parseFQBN(t, "my_avr_platform:avr:mymega"),
Verbose: true, Verbose: true,
} }
...@@ -68,7 +68,7 @@ func TestAddBuildBoardPropertyIfMissingNotMissing(t *testing.T) { ...@@ -68,7 +68,7 @@ func TestAddBuildBoardPropertyIfMissingNotMissing(t *testing.T) {
DownloadCoresAndToolsAndLibraries(t) DownloadCoresAndToolsAndLibraries(t)
ctx := &types.Context{ ctx := &types.Context{
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "hardware", "downloaded_hardware", "user_hardware"), HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware", "user_hardware"),
FQBN: parseFQBN(t, "my_avr_platform:avr:mymega:cpu=atmega1280"), FQBN: parseFQBN(t, "my_avr_platform:avr:mymega:cpu=atmega1280"),
Verbose: true, Verbose: true,
} }
......
...@@ -34,7 +34,7 @@ func prepareBuilderTestContext(t *testing.T, sketchPath *paths.Path, fqbn string ...@@ -34,7 +34,7 @@ func prepareBuilderTestContext(t *testing.T, sketchPath *paths.Path, fqbn string
return &types.Context{ return &types.Context{
SketchLocation: sketchPath, SketchLocation: sketchPath,
FQBN: parseFQBN(t, fqbn), FQBN: parseFQBN(t, fqbn),
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "hardware", "downloaded_hardware"), HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"),
BuiltInToolsDirs: paths.NewPathList("downloaded_tools"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools"),
BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"),
OtherLibrariesDirs: paths.NewPathList("libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"),
......
...@@ -32,7 +32,7 @@ func TestCTagsRunner(t *testing.T) { ...@@ -32,7 +32,7 @@ func TestCTagsRunner(t *testing.T) {
sketchLocation := Abs(t, paths.New("downloaded_libraries", "Bridge", "examples", "Bridge", "Bridge.ino")) sketchLocation := Abs(t, paths.New("downloaded_libraries", "Bridge", "examples", "Bridge", "Bridge.ino"))
ctx := &types.Context{ ctx := &types.Context{
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "hardware", "downloaded_hardware"), HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"),
BuiltInToolsDirs: paths.NewPathList("downloaded_tools"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools"),
BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"),
OtherLibrariesDirs: paths.NewPathList("libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"),
...@@ -82,7 +82,7 @@ func TestCTagsRunnerSketchWithClass(t *testing.T) { ...@@ -82,7 +82,7 @@ func TestCTagsRunnerSketchWithClass(t *testing.T) {
sketchLocation := Abs(t, paths.New("sketch_with_class", "sketch_with_class.ino")) sketchLocation := Abs(t, paths.New("sketch_with_class", "sketch_with_class.ino"))
ctx := &types.Context{ ctx := &types.Context{
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "hardware", "downloaded_hardware"), HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"),
BuiltInToolsDirs: paths.NewPathList("downloaded_tools"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools"),
BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"),
OtherLibrariesDirs: paths.NewPathList("libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"),
...@@ -130,7 +130,7 @@ func TestCTagsRunnerSketchWithTypename(t *testing.T) { ...@@ -130,7 +130,7 @@ func TestCTagsRunnerSketchWithTypename(t *testing.T) {
sketchLocation := Abs(t, paths.New("sketch_with_typename", "sketch_with_typename.ino")) sketchLocation := Abs(t, paths.New("sketch_with_typename", "sketch_with_typename.ino"))
ctx := &types.Context{ ctx := &types.Context{
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "hardware", "downloaded_hardware"), HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"),
BuiltInToolsDirs: paths.NewPathList("downloaded_tools"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools"),
BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"),
OtherLibrariesDirs: paths.NewPathList("libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"),
...@@ -177,7 +177,7 @@ func TestCTagsRunnerSketchWithNamespace(t *testing.T) { ...@@ -177,7 +177,7 @@ func TestCTagsRunnerSketchWithNamespace(t *testing.T) {
sketchLocation := Abs(t, paths.New("sketch_with_namespace", "sketch_with_namespace.ino")) sketchLocation := Abs(t, paths.New("sketch_with_namespace", "sketch_with_namespace.ino"))
ctx := &types.Context{ ctx := &types.Context{
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "hardware", "downloaded_hardware"), HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"),
BuiltInToolsDirs: paths.NewPathList("downloaded_tools"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools"),
BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"),
OtherLibrariesDirs: paths.NewPathList("libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"),
...@@ -223,7 +223,7 @@ func TestCTagsRunnerSketchWithTemplates(t *testing.T) { ...@@ -223,7 +223,7 @@ func TestCTagsRunnerSketchWithTemplates(t *testing.T) {
sketchLocation := Abs(t, paths.New("sketch_with_templates_and_shift", "sketch_with_templates_and_shift.cpp")) sketchLocation := Abs(t, paths.New("sketch_with_templates_and_shift", "sketch_with_templates_and_shift.cpp"))
ctx := &types.Context{ ctx := &types.Context{
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "hardware", "downloaded_hardware"), HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"),
BuiltInToolsDirs: paths.NewPathList("downloaded_tools"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools"),
BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"),
OtherLibrariesDirs: paths.NewPathList("libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"),
......
micro.vid.4=0x2341
micro.pid.4=0x0237
# If the board is a 2341:0237 use 2341:8237 for build and set
# other parameters as well
micro.vid.4.build.vid=0x2341
micro.vid.4.build.pid=0x8237
micro.vid.4.build.usb_product="Genuino Micro"
micro.vid.4.bootloader.file=caterina/Caterina-Genuino-Micro.hex
micro.vid.5=0x2341
micro.pid.5=0x8237
# If the board is a 2341:8237 use 2341:8237 for build and set
# other paramters as well
micro.vid.5.build.vid=0x2341
micro.vid.5.build.pid=0x8237
micro.vid.5.build.usb_product="Genuino Micro"
micro.vid.5.bootloader.file=caterina/Caterina-Genuino-Micro.hex
...@@ -28,8 +28,11 @@ import ( ...@@ -28,8 +28,11 @@ import (
func TestLoadHardware(t *testing.T) { func TestLoadHardware(t *testing.T) {
DownloadCoresAndToolsAndLibraries(t) DownloadCoresAndToolsAndLibraries(t)
downloadedHardwareAvr := paths.New("downloaded_hardware", "arduino", "avr")
paths.New("custom_local_txts", "boards.local.txt").CopyTo(downloadedHardwareAvr.Join("boards.local.txt"))
paths.New("custom_local_txts", "platform.local.txt").CopyTo(downloadedHardwareAvr.Join("platform.local.txt"))
ctx := &types.Context{ ctx := &types.Context{
HardwareDirs: paths.NewPathList("downloaded_hardware", filepath.Join("..", "hardware"), "hardware"), HardwareDirs: paths.NewPathList("downloaded_hardware", filepath.Join("..", "hardware")),
} }
commands := []types.Command{ commands := []types.Command{
...@@ -42,7 +45,7 @@ func TestLoadHardware(t *testing.T) { ...@@ -42,7 +45,7 @@ func TestLoadHardware(t *testing.T) {
} }
packages := ctx.Hardware packages := ctx.Hardware
require.Equal(t, 2, len(packages)) require.Equal(t, 1, len(packages))
require.NotNil(t, packages["arduino"]) require.NotNil(t, packages["arduino"])
require.Equal(t, 2, len(packages["arduino"].Platforms)) require.Equal(t, 2, len(packages["arduino"].Platforms))
...@@ -73,7 +76,7 @@ func TestLoadHardware(t *testing.T) { ...@@ -73,7 +76,7 @@ func TestLoadHardware(t *testing.T) {
func TestLoadHardwareMixingUserHardwareFolder(t *testing.T) { func TestLoadHardwareMixingUserHardwareFolder(t *testing.T) {
ctx := &types.Context{ ctx := &types.Context{
HardwareDirs: paths.NewPathList("downloaded_hardware", filepath.Join("..", "hardware"), "hardware", "user_hardware"), HardwareDirs: paths.NewPathList("downloaded_hardware", filepath.Join("..", "hardware"), "user_hardware"),
} }
commands := []types.Command{ commands := []types.Command{
...@@ -92,9 +95,9 @@ func TestLoadHardwareMixingUserHardwareFolder(t *testing.T) { ...@@ -92,9 +95,9 @@ func TestLoadHardwareMixingUserHardwareFolder(t *testing.T) {
if runtime.GOOS == "windows" { if runtime.GOOS == "windows" {
//a package is a symlink, and windows does not support them //a package is a symlink, and windows does not support them
require.Equal(t, 3, len(packages)) require.Equal(t, 2, len(packages))
} else { } else {
require.Equal(t, 4, len(packages)) require.Equal(t, 3, len(packages))
} }
require.NotNil(t, packages["arduino"]) require.NotNil(t, packages["arduino"])
...@@ -191,7 +194,7 @@ func TestLoadHardwareWithBoardManagerFolderStructure(t *testing.T) { ...@@ -191,7 +194,7 @@ func TestLoadHardwareWithBoardManagerFolderStructure(t *testing.T) {
func TestLoadLotsOfHardware(t *testing.T) { func TestLoadLotsOfHardware(t *testing.T) {
ctx := &types.Context{ ctx := &types.Context{
HardwareDirs: paths.NewPathList("downloaded_board_manager_stuff", "downloaded_hardware", filepath.Join("..", "hardware"), "hardware", "user_hardware"), HardwareDirs: paths.NewPathList("downloaded_board_manager_stuff", "downloaded_hardware", filepath.Join("..", "hardware"), "user_hardware"),
} }
commands := []types.Command{ commands := []types.Command{
...@@ -207,9 +210,9 @@ func TestLoadLotsOfHardware(t *testing.T) { ...@@ -207,9 +210,9 @@ func TestLoadLotsOfHardware(t *testing.T) {
if runtime.GOOS == "windows" { if runtime.GOOS == "windows" {
//a package is a symlink, and windows does not support them //a package is a symlink, and windows does not support them
require.Equal(t, 5, len(packages)) require.Equal(t, 4, len(packages))
} else { } else {
require.Equal(t, 6, len(packages)) require.Equal(t, 5, len(packages))
} }
require.NotNil(t, packages["arduino"]) require.NotNil(t, packages["arduino"])
......
...@@ -30,7 +30,7 @@ func TestIncludesToIncludeFolders(t *testing.T) { ...@@ -30,7 +30,7 @@ func TestIncludesToIncludeFolders(t *testing.T) {
DownloadCoresAndToolsAndLibraries(t) DownloadCoresAndToolsAndLibraries(t)
ctx := &types.Context{ ctx := &types.Context{
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "hardware", "downloaded_hardware"), HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"),
BuiltInToolsDirs: paths.NewPathList("downloaded_tools"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools"),
BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"),
OtherLibrariesDirs: paths.NewPathList("libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"),
...@@ -66,7 +66,7 @@ func TestIncludesToIncludeFoldersSketchWithIfDef(t *testing.T) { ...@@ -66,7 +66,7 @@ func TestIncludesToIncludeFoldersSketchWithIfDef(t *testing.T) {
DownloadCoresAndToolsAndLibraries(t) DownloadCoresAndToolsAndLibraries(t)
ctx := &types.Context{ ctx := &types.Context{
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "hardware", "downloaded_hardware"), HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"),
BuiltInToolsDirs: paths.NewPathList("downloaded_tools"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools"),
BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"),
OtherLibrariesDirs: paths.NewPathList("libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"),
...@@ -101,7 +101,7 @@ func TestIncludesToIncludeFoldersIRremoteLibrary(t *testing.T) { ...@@ -101,7 +101,7 @@ func TestIncludesToIncludeFoldersIRremoteLibrary(t *testing.T) {
DownloadCoresAndToolsAndLibraries(t) DownloadCoresAndToolsAndLibraries(t)
ctx := &types.Context{ ctx := &types.Context{
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "hardware", "downloaded_hardware"), HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"),
BuiltInToolsDirs: paths.NewPathList("downloaded_tools"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools"),
BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"),
OtherLibrariesDirs: paths.NewPathList("libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"),
...@@ -139,7 +139,7 @@ func TestIncludesToIncludeFoldersANewLibrary(t *testing.T) { ...@@ -139,7 +139,7 @@ func TestIncludesToIncludeFoldersANewLibrary(t *testing.T) {
DownloadCoresAndToolsAndLibraries(t) DownloadCoresAndToolsAndLibraries(t)
ctx := &types.Context{ ctx := &types.Context{
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "hardware", "downloaded_hardware"), HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"),
BuiltInToolsDirs: paths.NewPathList("downloaded_tools"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools"),
BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"),
OtherLibrariesDirs: paths.NewPathList("libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"),
...@@ -174,7 +174,7 @@ func TestIncludesToIncludeFoldersDuplicateLibs(t *testing.T) { ...@@ -174,7 +174,7 @@ func TestIncludesToIncludeFoldersDuplicateLibs(t *testing.T) {
DownloadCoresAndToolsAndLibraries(t) DownloadCoresAndToolsAndLibraries(t)
ctx := &types.Context{ ctx := &types.Context{
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "hardware", "downloaded_hardware", "user_hardware"), HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware", "user_hardware"),
BuiltInToolsDirs: paths.NewPathList("downloaded_tools"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools"),
BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"),
SketchLocation: paths.New("user_hardware", "my_avr_platform", "avr", "libraries", "SPI", "examples", "BarometricPressureSensor", "BarometricPressureSensor.ino"), SketchLocation: paths.New("user_hardware", "my_avr_platform", "avr", "libraries", "SPI", "examples", "BarometricPressureSensor", "BarometricPressureSensor.ino"),
...@@ -211,7 +211,7 @@ func TestIncludesToIncludeFoldersDuplicateLibsWithConflictingLibsOutsideOfPlatfo ...@@ -211,7 +211,7 @@ func TestIncludesToIncludeFoldersDuplicateLibsWithConflictingLibsOutsideOfPlatfo
DownloadCoresAndToolsAndLibraries(t) DownloadCoresAndToolsAndLibraries(t)
ctx := &types.Context{ ctx := &types.Context{
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "hardware", "downloaded_hardware", "user_hardware"), HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware", "user_hardware"),
BuiltInToolsDirs: paths.NewPathList("downloaded_tools"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools"),
BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"),
OtherLibrariesDirs: paths.NewPathList("libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"),
...@@ -249,7 +249,7 @@ func TestIncludesToIncludeFoldersDuplicateLibs2(t *testing.T) { ...@@ -249,7 +249,7 @@ func TestIncludesToIncludeFoldersDuplicateLibs2(t *testing.T) {
DownloadCoresAndToolsAndLibraries(t) DownloadCoresAndToolsAndLibraries(t)
ctx := &types.Context{ ctx := &types.Context{
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "hardware", "downloaded_hardware", "downloaded_board_manager_stuff"), HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware", "downloaded_board_manager_stuff"),
BuiltInToolsDirs: paths.NewPathList("downloaded_tools"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools"),
BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"),
OtherLibrariesDirs: paths.NewPathList("libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"),
...@@ -287,7 +287,7 @@ func TestIncludesToIncludeFoldersSubfolders(t *testing.T) { ...@@ -287,7 +287,7 @@ func TestIncludesToIncludeFoldersSubfolders(t *testing.T) {
DownloadCoresAndToolsAndLibraries(t) DownloadCoresAndToolsAndLibraries(t)
ctx := &types.Context{ ctx := &types.Context{
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "hardware", "downloaded_hardware"), HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"),
BuiltInToolsDirs: paths.NewPathList("downloaded_tools"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools"),
BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"),
OtherLibrariesDirs: paths.NewPathList("libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"),
......
...@@ -41,7 +41,7 @@ func TestLoadLibrariesAVR(t *testing.T) { ...@@ -41,7 +41,7 @@ func TestLoadLibrariesAVR(t *testing.T) {
DownloadCoresAndToolsAndLibraries(t) DownloadCoresAndToolsAndLibraries(t)
ctx := &types.Context{ ctx := &types.Context{
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "hardware", "downloaded_hardware"), HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"),
BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"),
OtherLibrariesDirs: paths.NewPathList("libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"),
FQBN: parseFQBN(t, "arduino:avr:leonardo"), FQBN: parseFQBN(t, "arduino:avr:leonardo"),
...@@ -151,7 +151,7 @@ func TestLoadLibrariesSAM(t *testing.T) { ...@@ -151,7 +151,7 @@ func TestLoadLibrariesSAM(t *testing.T) {
DownloadCoresAndToolsAndLibraries(t) DownloadCoresAndToolsAndLibraries(t)
ctx := &types.Context{ ctx := &types.Context{
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "hardware", "downloaded_hardware"), HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"),
BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"),
OtherLibrariesDirs: paths.NewPathList("libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"),
FQBN: parseFQBN(t, "arduino:sam:arduino_due_x_dbg"), FQBN: parseFQBN(t, "arduino:sam:arduino_due_x_dbg"),
...@@ -234,7 +234,7 @@ func TestLoadLibrariesAVRNoDuplicateLibrariesFolders(t *testing.T) { ...@@ -234,7 +234,7 @@ func TestLoadLibrariesAVRNoDuplicateLibrariesFolders(t *testing.T) {
DownloadCoresAndToolsAndLibraries(t) DownloadCoresAndToolsAndLibraries(t)
ctx := &types.Context{ ctx := &types.Context{
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "hardware", "downloaded_hardware"), HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"),
BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"),
OtherLibrariesDirs: paths.NewPathList("libraries", filepath.Join("downloaded_hardware", "arduino", "avr", "libraries")), OtherLibrariesDirs: paths.NewPathList("libraries", filepath.Join("downloaded_hardware", "arduino", "avr", "libraries")),
FQBN: parseFQBN(t, "arduino:avr:leonardo"), FQBN: parseFQBN(t, "arduino:avr:leonardo"),
...@@ -263,7 +263,7 @@ func TestLoadLibrariesMyAVRPlatform(t *testing.T) { ...@@ -263,7 +263,7 @@ func TestLoadLibrariesMyAVRPlatform(t *testing.T) {
DownloadCoresAndToolsAndLibraries(t) DownloadCoresAndToolsAndLibraries(t)
ctx := &types.Context{ ctx := &types.Context{
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "hardware", "user_hardware", "downloaded_hardware"), HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "user_hardware", "downloaded_hardware"),
BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"),
OtherLibrariesDirs: paths.NewPathList("libraries", filepath.Join("downloaded_hardware", "arduino", "avr", "libraries")), OtherLibrariesDirs: paths.NewPathList("libraries", filepath.Join("downloaded_hardware", "arduino", "avr", "libraries")),
FQBN: parseFQBN(t, "my_avr_platform:avr:custom_yun"), FQBN: parseFQBN(t, "my_avr_platform:avr:custom_yun"),
......
...@@ -29,7 +29,7 @@ func TestLoadVIDPIDSpecificPropertiesWhenNoVIDPIDAreProvided(t *testing.T) { ...@@ -29,7 +29,7 @@ func TestLoadVIDPIDSpecificPropertiesWhenNoVIDPIDAreProvided(t *testing.T) {
DownloadCoresAndToolsAndLibraries(t) DownloadCoresAndToolsAndLibraries(t)
ctx := &types.Context{ ctx := &types.Context{
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "hardware", "downloaded_hardware"), HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"),
BuiltInToolsDirs: paths.NewPathList("downloaded_tools", "./tools_builtin"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools", "./tools_builtin"),
SketchLocation: paths.New("sketch1", "sketch1.ino"), SketchLocation: paths.New("sketch1", "sketch1.ino"),
FQBN: parseFQBN(t, "arduino:avr:micro"), FQBN: parseFQBN(t, "arduino:avr:micro"),
...@@ -59,7 +59,7 @@ func TestLoadVIDPIDSpecificProperties(t *testing.T) { ...@@ -59,7 +59,7 @@ func TestLoadVIDPIDSpecificProperties(t *testing.T) {
DownloadCoresAndToolsAndLibraries(t) DownloadCoresAndToolsAndLibraries(t)
ctx := &types.Context{ ctx := &types.Context{
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "hardware", "downloaded_hardware"), HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"),
BuiltInToolsDirs: paths.NewPathList("downloaded_tools", "./tools_builtin"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools", "./tools_builtin"),
SketchLocation: paths.New("sketch1", "sketch1.ino"), SketchLocation: paths.New("sketch1", "sketch1.ino"),
FQBN: parseFQBN(t, "arduino:avr:micro"), FQBN: parseFQBN(t, "arduino:avr:micro"),
......
...@@ -32,7 +32,7 @@ func TestMergeSketchWithBootloader(t *testing.T) { ...@@ -32,7 +32,7 @@ func TestMergeSketchWithBootloader(t *testing.T) {
DownloadCoresAndToolsAndLibraries(t) DownloadCoresAndToolsAndLibraries(t)
ctx := &types.Context{ ctx := &types.Context{
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "hardware", "downloaded_hardware"), HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"),
BuiltInToolsDirs: paths.NewPathList("downloaded_tools"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools"),
BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"),
OtherLibrariesDirs: paths.NewPathList("libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"),
...@@ -102,7 +102,7 @@ func TestMergeSketchWithBootloaderSketchInBuildPath(t *testing.T) { ...@@ -102,7 +102,7 @@ func TestMergeSketchWithBootloaderSketchInBuildPath(t *testing.T) {
DownloadCoresAndToolsAndLibraries(t) DownloadCoresAndToolsAndLibraries(t)
ctx := &types.Context{ ctx := &types.Context{
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "hardware", "downloaded_hardware"), HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"),
BuiltInToolsDirs: paths.NewPathList("downloaded_tools"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools"),
BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"),
OtherLibrariesDirs: paths.NewPathList("libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"),
...@@ -173,7 +173,7 @@ func TestMergeSketchWithBootloaderWhenNoBootloaderAvailable(t *testing.T) { ...@@ -173,7 +173,7 @@ func TestMergeSketchWithBootloaderWhenNoBootloaderAvailable(t *testing.T) {
DownloadCoresAndToolsAndLibraries(t) DownloadCoresAndToolsAndLibraries(t)
ctx := &types.Context{ ctx := &types.Context{
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "hardware", "downloaded_hardware"), HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"),
BuiltInToolsDirs: paths.NewPathList("downloaded_tools"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools"),
BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"),
OtherLibrariesDirs: paths.NewPathList("libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"),
...@@ -211,7 +211,7 @@ func TestMergeSketchWithBootloaderPathIsParameterized(t *testing.T) { ...@@ -211,7 +211,7 @@ func TestMergeSketchWithBootloaderPathIsParameterized(t *testing.T) {
DownloadCoresAndToolsAndLibraries(t) DownloadCoresAndToolsAndLibraries(t)
ctx := &types.Context{ ctx := &types.Context{
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "hardware", "downloaded_hardware", "user_hardware"), HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware", "user_hardware"),
BuiltInToolsDirs: paths.NewPathList("downloaded_tools"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools"),
BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"),
OtherLibrariesDirs: paths.NewPathList("libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"),
......
...@@ -27,7 +27,7 @@ import ( ...@@ -27,7 +27,7 @@ import (
func TestLoadPlatformKeysRewrite(t *testing.T) { func TestLoadPlatformKeysRewrite(t *testing.T) {
ctx := &types.Context{ ctx := &types.Context{
HardwareDirs: paths.NewPathList("downloaded_hardware", filepath.Join("..", "hardware"), "hardware"), HardwareDirs: paths.NewPathList("downloaded_hardware", filepath.Join("..", "hardware")),
} }
commands := []types.Command{ commands := []types.Command{
......
...@@ -29,7 +29,7 @@ func TestSetupBuildProperties(t *testing.T) { ...@@ -29,7 +29,7 @@ func TestSetupBuildProperties(t *testing.T) {
DownloadCoresAndToolsAndLibraries(t) DownloadCoresAndToolsAndLibraries(t)
ctx := &types.Context{ ctx := &types.Context{
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "hardware", "downloaded_hardware", "user_hardware"), HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware", "user_hardware"),
BuiltInToolsDirs: paths.NewPathList("downloaded_tools", "tools_builtin"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools", "tools_builtin"),
SketchLocation: paths.New("sketch1", "sketch1.ino"), SketchLocation: paths.New("sketch1", "sketch1.ino"),
FQBN: parseFQBN(t, "arduino:avr:uno"), FQBN: parseFQBN(t, "arduino:avr:uno"),
...@@ -95,7 +95,7 @@ func TestSetupBuildPropertiesWithSomeCustomOverrides(t *testing.T) { ...@@ -95,7 +95,7 @@ func TestSetupBuildPropertiesWithSomeCustomOverrides(t *testing.T) {
DownloadCoresAndToolsAndLibraries(t) DownloadCoresAndToolsAndLibraries(t)
ctx := &types.Context{ ctx := &types.Context{
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "hardware", "downloaded_hardware"), HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"),
BuiltInToolsDirs: paths.NewPathList("downloaded_tools", "tools_builtin"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools", "tools_builtin"),
SketchLocation: paths.New("sketch1", "sketch1.ino"), SketchLocation: paths.New("sketch1", "sketch1.ino"),
FQBN: parseFQBN(t, "arduino:avr:uno"), FQBN: parseFQBN(t, "arduino:avr:uno"),
...@@ -136,7 +136,7 @@ func TestSetupBuildPropertiesUserHardware(t *testing.T) { ...@@ -136,7 +136,7 @@ func TestSetupBuildPropertiesUserHardware(t *testing.T) {
DownloadCoresAndToolsAndLibraries(t) DownloadCoresAndToolsAndLibraries(t)
ctx := &types.Context{ ctx := &types.Context{
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "hardware", "downloaded_hardware", "user_hardware"), HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware", "user_hardware"),
BuiltInToolsDirs: paths.NewPathList("downloaded_tools", "tools_builtin"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools", "tools_builtin"),
SketchLocation: paths.New("sketch1", "sketch1.ino"), SketchLocation: paths.New("sketch1", "sketch1.ino"),
FQBN: parseFQBN(t, "my_avr_platform:avr:custom_yun"), FQBN: parseFQBN(t, "my_avr_platform:avr:custom_yun"),
...@@ -174,7 +174,7 @@ func TestSetupBuildPropertiesWithMissingPropsFromParentPlatformTxtFiles(t *testi ...@@ -174,7 +174,7 @@ func TestSetupBuildPropertiesWithMissingPropsFromParentPlatformTxtFiles(t *testi
DownloadCoresAndToolsAndLibraries(t) DownloadCoresAndToolsAndLibraries(t)
ctx := &types.Context{ ctx := &types.Context{
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "hardware", "downloaded_hardware", "user_hardware"), HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware", "user_hardware"),
BuiltInToolsDirs: paths.NewPathList("downloaded_tools", "tools_builtin"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools", "tools_builtin"),
SketchLocation: paths.New("sketch1", "sketch1.ino"), SketchLocation: paths.New("sketch1", "sketch1.ino"),
FQBN: parseFQBN(t, "my_avr_platform:avr:custom_yun"), FQBN: parseFQBN(t, "my_avr_platform:avr:custom_yun"),
......
...@@ -27,7 +27,7 @@ import ( ...@@ -27,7 +27,7 @@ import (
func TestTargetBoardResolverUno(t *testing.T) { func TestTargetBoardResolverUno(t *testing.T) {
ctx := &types.Context{ ctx := &types.Context{
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "hardware", "downloaded_hardware"), HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"),
FQBN: parseFQBN(t, "arduino:avr:uno"), FQBN: parseFQBN(t, "arduino:avr:uno"),
} }
...@@ -52,7 +52,7 @@ func TestTargetBoardResolverUno(t *testing.T) { ...@@ -52,7 +52,7 @@ func TestTargetBoardResolverUno(t *testing.T) {
func TestTargetBoardResolverDue(t *testing.T) { func TestTargetBoardResolverDue(t *testing.T) {
ctx := &types.Context{ ctx := &types.Context{
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "hardware", "downloaded_hardware"), HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"),
FQBN: parseFQBN(t, "arduino:sam:arduino_due_x"), FQBN: parseFQBN(t, "arduino:sam:arduino_due_x"),
} }
...@@ -77,7 +77,7 @@ func TestTargetBoardResolverDue(t *testing.T) { ...@@ -77,7 +77,7 @@ func TestTargetBoardResolverDue(t *testing.T) {
func TestTargetBoardResolverMega1280(t *testing.T) { func TestTargetBoardResolverMega1280(t *testing.T) {
ctx := &types.Context{ ctx := &types.Context{
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "hardware", "downloaded_hardware"), HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"),
FQBN: parseFQBN(t, "arduino:avr:mega:cpu=atmega1280"), FQBN: parseFQBN(t, "arduino:avr:mega:cpu=atmega1280"),
} }
...@@ -103,7 +103,7 @@ func TestTargetBoardResolverMega1280(t *testing.T) { ...@@ -103,7 +103,7 @@ func TestTargetBoardResolverMega1280(t *testing.T) {
func TestTargetBoardResolverMega2560(t *testing.T) { func TestTargetBoardResolverMega2560(t *testing.T) {
ctx := &types.Context{ ctx := &types.Context{
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "hardware", "downloaded_hardware"), HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"),
FQBN: parseFQBN(t, "arduino:avr:mega:cpu=atmega2560"), FQBN: parseFQBN(t, "arduino:avr:mega:cpu=atmega2560"),
} }
...@@ -129,7 +129,7 @@ func TestTargetBoardResolverMega2560(t *testing.T) { ...@@ -129,7 +129,7 @@ func TestTargetBoardResolverMega2560(t *testing.T) {
func TestTargetBoardResolverCustomYun(t *testing.T) { func TestTargetBoardResolverCustomYun(t *testing.T) {
ctx := &types.Context{ ctx := &types.Context{
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "hardware", "downloaded_hardware", "user_hardware"), HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware", "user_hardware"),
FQBN: parseFQBN(t, "my_avr_platform:avr:custom_yun"), FQBN: parseFQBN(t, "my_avr_platform:avr:custom_yun"),
} }
...@@ -155,7 +155,7 @@ func TestTargetBoardResolverCustomYun(t *testing.T) { ...@@ -155,7 +155,7 @@ func TestTargetBoardResolverCustomYun(t *testing.T) {
func TestTargetBoardResolverCustomCore(t *testing.T) { func TestTargetBoardResolverCustomCore(t *testing.T) {
ctx := &types.Context{ ctx := &types.Context{
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "hardware", "downloaded_hardware", "user_hardware"), HardwareDirs: paths.NewPathList("hardware"),
FQBN: parseFQBN(t, "watterott:avr:attiny841:core=spencekonde,info=info"), FQBN: parseFQBN(t, "watterott:avr:attiny841:core=spencekonde,info=info"),
} }
......
...@@ -208,7 +208,7 @@ func makeDefaultContext(t *testing.T) *types.Context { ...@@ -208,7 +208,7 @@ func makeDefaultContext(t *testing.T) *types.Context {
DownloadCoresAndToolsAndLibraries(t) DownloadCoresAndToolsAndLibraries(t)
ctx := &types.Context{ ctx := &types.Context{
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "hardware", "downloaded_hardware", "downloaded_board_manager_stuff"), HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware", "downloaded_board_manager_stuff"),
BuiltInToolsDirs: paths.NewPathList("downloaded_tools"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools"),
BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"),
OtherLibrariesDirs: paths.NewPathList("libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment