Skip to content

Commit 7abe105

Browse files
committed
[skip changelog] Fix legacy tests
1 parent 5b3b4f1 commit 7abe105

File tree

49 files changed

+85
-85
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+85
-85
lines changed

legacy/builder/test/builder_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func prepareBuilderTestContext(t *testing.T, sketchPath *paths.Path, fqbn string
4646
func TestBuilderEmptySketch(t *testing.T) {
4747
DownloadCoresAndToolsAndLibraries(t)
4848

49-
ctx := prepareBuilderTestContext(t, paths.New("sketch1", "sketch.ino"), "arduino:avr:uno")
49+
ctx := prepareBuilderTestContext(t, paths.New("sketch1", "sketch1.ino"), "arduino:avr:uno")
5050
ctx.DebugLevel = 10
5151

5252
buildPath := SetupBuildPath(t, ctx)
@@ -63,13 +63,13 @@ func TestBuilderEmptySketch(t *testing.T) {
6363
exist, err = buildPath.Join(constants.FOLDER_PREPROC, constants.FILE_CTAGS_TARGET_FOR_GCC_MINUS_E).ExistCheck()
6464
NoError(t, err)
6565
require.True(t, exist)
66-
exist, err = buildPath.Join(constants.FOLDER_SKETCH, "sketch.ino.cpp.o").ExistCheck()
66+
exist, err = buildPath.Join(constants.FOLDER_SKETCH, "sketch1.ino.cpp.o").ExistCheck()
6767
NoError(t, err)
6868
require.True(t, exist)
69-
exist, err = buildPath.Join("sketch.ino.elf").ExistCheck()
69+
exist, err = buildPath.Join("sketch1.ino.elf").ExistCheck()
7070
NoError(t, err)
7171
require.True(t, exist)
72-
exist, err = buildPath.Join("sketch.ino.hex").ExistCheck()
72+
exist, err = buildPath.Join("sketch1.ino.hex").ExistCheck()
7373
NoError(t, err)
7474
require.True(t, exist)
7575
}
@@ -277,7 +277,7 @@ func TestBuilderSketchNoFunctions(t *testing.T) {
277277
func TestBuilderSketchWithBackup(t *testing.T) {
278278
DownloadCoresAndToolsAndLibraries(t)
279279

280-
ctx := prepareBuilderTestContext(t, paths.New("sketch_with_backup_files", "sketch.ino"), "arduino:avr:uno")
280+
ctx := prepareBuilderTestContext(t, paths.New("sketch_with_backup_files", "sketch_with_backup_files.ino"), "arduino:avr:uno")
281281
ctx.HardwareDirs = append(ctx.HardwareDirs, paths.New("downloaded_board_manager_stuff"))
282282
ctx.BuiltInToolsDirs = append(ctx.BuiltInToolsDirs, paths.New("downloaded_board_manager_stuff"))
283283

@@ -293,7 +293,7 @@ func TestBuilderSketchWithBackup(t *testing.T) {
293293
func TestBuilderSketchWithOldLib(t *testing.T) {
294294
DownloadCoresAndToolsAndLibraries(t)
295295

296-
ctx := prepareBuilderTestContext(t, paths.New("sketch_with_old_lib", "sketch.ino"), "arduino:avr:uno")
296+
ctx := prepareBuilderTestContext(t, paths.New("sketch_with_old_lib", "sketch_with_old_lib.ino"), "arduino:avr:uno")
297297

298298
buildPath := SetupBuildPath(t, ctx)
299299
defer buildPath.RemoveAll()
@@ -344,7 +344,7 @@ func TestBuilderSketchBuildPathContainsUnusedPreviouslyCompiledLibrary(t *testin
344344
func TestBuilderWithBuildPathInSketchDir(t *testing.T) {
345345
DownloadCoresAndToolsAndLibraries(t)
346346

347-
ctx := prepareBuilderTestContext(t, paths.New("sketch1", "sketch.ino"), "arduino:avr:uno")
347+
ctx := prepareBuilderTestContext(t, paths.New("sketch1", "sketch1.ino"), "arduino:avr:uno")
348348

349349
var err error
350350
ctx.BuildPath, err = paths.New("sketch1", "build").Abs()
@@ -365,7 +365,7 @@ func TestBuilderWithBuildPathInSketchDir(t *testing.T) {
365365
func TestBuilderCacheCoreAFile(t *testing.T) {
366366
DownloadCoresAndToolsAndLibraries(t)
367367

368-
ctx := prepareBuilderTestContext(t, paths.New("sketch1", "sketch.ino"), "arduino:avr:uno")
368+
ctx := prepareBuilderTestContext(t, paths.New("sketch1", "sketch1.ino"), "arduino:avr:uno")
369369

370370
SetupBuildPath(t, ctx)
371371
defer ctx.BuildPath.RemoveAll()

legacy/builder/test/ctags_runner_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ func TestCTagsRunner(t *testing.T) {
7979
func TestCTagsRunnerSketchWithClass(t *testing.T) {
8080
DownloadCoresAndToolsAndLibraries(t)
8181

82-
sketchLocation := Abs(t, paths.New("sketch_with_class", "sketch.ino"))
82+
sketchLocation := Abs(t, paths.New("sketch_with_class", "sketch_with_class.ino"))
8383

8484
ctx := &types.Context{
8585
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "hardware", "downloaded_hardware"),
@@ -127,7 +127,7 @@ func TestCTagsRunnerSketchWithClass(t *testing.T) {
127127
func TestCTagsRunnerSketchWithTypename(t *testing.T) {
128128
DownloadCoresAndToolsAndLibraries(t)
129129

130-
sketchLocation := Abs(t, paths.New("sketch_with_typename", "sketch.ino"))
130+
sketchLocation := Abs(t, paths.New("sketch_with_typename", "sketch_with_typename.ino"))
131131

132132
ctx := &types.Context{
133133
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "hardware", "downloaded_hardware"),
@@ -174,7 +174,7 @@ func TestCTagsRunnerSketchWithTypename(t *testing.T) {
174174
func TestCTagsRunnerSketchWithNamespace(t *testing.T) {
175175
DownloadCoresAndToolsAndLibraries(t)
176176

177-
sketchLocation := Abs(t, paths.New("sketch_with_namespace", "sketch.ino"))
177+
sketchLocation := Abs(t, paths.New("sketch_with_namespace", "sketch_with_namespace.ino"))
178178

179179
ctx := &types.Context{
180180
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "hardware", "downloaded_hardware"),
@@ -220,7 +220,7 @@ func TestCTagsRunnerSketchWithNamespace(t *testing.T) {
220220
func TestCTagsRunnerSketchWithTemplates(t *testing.T) {
221221
DownloadCoresAndToolsAndLibraries(t)
222222

223-
sketchLocation := Abs(t, paths.New("sketch_with_templates_and_shift", "template_and_shift.cpp"))
223+
sketchLocation := Abs(t, paths.New("sketch_with_templates_and_shift", "sketch_with_templates_and_shift.cpp"))
224224

225225
ctx := &types.Context{
226226
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "hardware", "downloaded_hardware"),

legacy/builder/test/includes_to_include_folders_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ func TestIncludesToIncludeFoldersSketchWithIfDef(t *testing.T) {
7070
BuiltInToolsDirs: paths.NewPathList("downloaded_tools"),
7171
BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"),
7272
OtherLibrariesDirs: paths.NewPathList("libraries"),
73-
SketchLocation: paths.New("sketch2", "SketchWithIfDef.ino"),
73+
SketchLocation: paths.New("SketchWithIfDef", "SketchWithIfDef.ino"),
7474
FQBN: parseFQBN(t, "arduino:avr:leonardo"),
7575
ArduinoAPIVersion: "10600",
7676
Verbose: true,
@@ -105,7 +105,7 @@ func TestIncludesToIncludeFoldersIRremoteLibrary(t *testing.T) {
105105
BuiltInToolsDirs: paths.NewPathList("downloaded_tools"),
106106
BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"),
107107
OtherLibrariesDirs: paths.NewPathList("libraries"),
108-
SketchLocation: paths.New("sketch9", "sketch.ino"),
108+
SketchLocation: paths.New("sketch9", "sketch9.ino"),
109109
FQBN: parseFQBN(t, "arduino:avr:leonardo"),
110110
ArduinoAPIVersion: "10600",
111111
Verbose: true,
@@ -143,7 +143,7 @@ func TestIncludesToIncludeFoldersANewLibrary(t *testing.T) {
143143
BuiltInToolsDirs: paths.NewPathList("downloaded_tools"),
144144
BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"),
145145
OtherLibrariesDirs: paths.NewPathList("libraries"),
146-
SketchLocation: paths.New("sketch10", "sketch.ino"),
146+
SketchLocation: paths.New("sketch10", "sketch10.ino"),
147147
FQBN: parseFQBN(t, "arduino:avr:leonardo"),
148148
ArduinoAPIVersion: "10600",
149149
Verbose: true,

legacy/builder/test/load_vid_pid_specific_properties_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func TestLoadVIDPIDSpecificPropertiesWhenNoVIDPIDAreProvided(t *testing.T) {
3131
ctx := &types.Context{
3232
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "hardware", "downloaded_hardware"),
3333
BuiltInToolsDirs: paths.NewPathList("downloaded_tools", "./tools_builtin"),
34-
SketchLocation: paths.New("sketch1", "sketch.ino"),
34+
SketchLocation: paths.New("sketch1", "sketch1.ino"),
3535
FQBN: parseFQBN(t, "arduino:avr:micro"),
3636
ArduinoAPIVersion: "10600",
3737
}
@@ -61,7 +61,7 @@ func TestLoadVIDPIDSpecificProperties(t *testing.T) {
6161
ctx := &types.Context{
6262
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "hardware", "downloaded_hardware"),
6363
BuiltInToolsDirs: paths.NewPathList("downloaded_tools", "./tools_builtin"),
64-
SketchLocation: paths.New("sketch1", "sketch.ino"),
64+
SketchLocation: paths.New("sketch1", "sketch1.ino"),
6565
FQBN: parseFQBN(t, "arduino:avr:micro"),
6666
ArduinoAPIVersion: "10600",
6767
}

legacy/builder/test/merge_sketch_with_bootloader_test.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func TestMergeSketchWithBootloader(t *testing.T) {
3636
BuiltInToolsDirs: paths.NewPathList("downloaded_tools"),
3737
BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"),
3838
OtherLibrariesDirs: paths.NewPathList("libraries"),
39-
SketchLocation: paths.New("sketch1", "sketch.ino"),
39+
SketchLocation: paths.New("sketch1", "sketch1.ino"),
4040
FQBN: parseFQBN(t, "arduino:avr:uno"),
4141
ArduinoAPIVersion: "10600",
4242
}
@@ -77,7 +77,7 @@ func TestMergeSketchWithBootloader(t *testing.T) {
7777
:0C01B000F1F30E940000FBCFF894FFCF99
7878
:00000001FF
7979
`
80-
err = buildPath.Join("sketch", "sketch.ino.hex").WriteFile([]byte(fakeSketchHex))
80+
err = buildPath.Join("sketch", "sketch1.ino.hex").WriteFile([]byte(fakeSketchHex))
8181
NoError(t, err)
8282

8383
commands := []types.Command{
@@ -90,7 +90,7 @@ func TestMergeSketchWithBootloader(t *testing.T) {
9090
NoError(t, err)
9191
}
9292

93-
bytes, err := buildPath.Join("sketch", "sketch.ino.with_bootloader.hex").ReadFile()
93+
bytes, err := buildPath.Join("sketch", "sketch1.ino.with_bootloader.hex").ReadFile()
9494
NoError(t, err)
9595
mergedSketchHex := string(bytes)
9696

@@ -106,7 +106,7 @@ func TestMergeSketchWithBootloaderSketchInBuildPath(t *testing.T) {
106106
BuiltInToolsDirs: paths.NewPathList("downloaded_tools"),
107107
BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"),
108108
OtherLibrariesDirs: paths.NewPathList("libraries"),
109-
SketchLocation: paths.New("sketch1", "sketch.ino"),
109+
SketchLocation: paths.New("sketch1", "sketch1.ino"),
110110
FQBN: parseFQBN(t, "arduino:avr:uno"),
111111
ArduinoAPIVersion: "10600",
112112
}
@@ -147,7 +147,7 @@ func TestMergeSketchWithBootloaderSketchInBuildPath(t *testing.T) {
147147
:0C01B000F1F30E940000FBCFF894FFCF99
148148
:00000001FF
149149
`
150-
err = buildPath.Join("sketch.ino.hex").WriteFile([]byte(fakeSketchHex))
150+
err = buildPath.Join("sketch1.ino.hex").WriteFile([]byte(fakeSketchHex))
151151
NoError(t, err)
152152

153153
commands := []types.Command{
@@ -160,7 +160,7 @@ func TestMergeSketchWithBootloaderSketchInBuildPath(t *testing.T) {
160160
NoError(t, err)
161161
}
162162

163-
bytes, err := buildPath.Join("sketch.ino.with_bootloader.hex").ReadFile()
163+
bytes, err := buildPath.Join("sketch1.ino.with_bootloader.hex").ReadFile()
164164
NoError(t, err)
165165
mergedSketchHex := string(bytes)
166166

@@ -177,7 +177,7 @@ func TestMergeSketchWithBootloaderWhenNoBootloaderAvailable(t *testing.T) {
177177
BuiltInToolsDirs: paths.NewPathList("downloaded_tools"),
178178
BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"),
179179
OtherLibrariesDirs: paths.NewPathList("libraries"),
180-
SketchLocation: paths.New("sketch1", "sketch.ino"),
180+
SketchLocation: paths.New("sketch1", "sketch1.ino"),
181181
FQBN: parseFQBN(t, "arduino:avr:uno"),
182182
ArduinoAPIVersion: "10600",
183183
}
@@ -215,7 +215,7 @@ func TestMergeSketchWithBootloaderPathIsParameterized(t *testing.T) {
215215
BuiltInToolsDirs: paths.NewPathList("downloaded_tools"),
216216
BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"),
217217
OtherLibrariesDirs: paths.NewPathList("libraries"),
218-
SketchLocation: paths.New("sketch1", "sketch.ino"),
218+
SketchLocation: paths.New("sketch1", "sketch1.ino"),
219219
FQBN: parseFQBN(t, "my_avr_platform:avr:mymega:cpu=atmega2560"),
220220
ArduinoAPIVersion: "10600",
221221
}
@@ -256,7 +256,7 @@ func TestMergeSketchWithBootloaderPathIsParameterized(t *testing.T) {
256256
:0C01B000F1F30E940000FBCFF894FFCF99
257257
:00000001FF
258258
`
259-
err = buildPath.Join("sketch", "sketch.ino.hex").WriteFile([]byte(fakeSketchHex))
259+
err = buildPath.Join("sketch", "sketch1.ino.hex").WriteFile([]byte(fakeSketchHex))
260260
NoError(t, err)
261261

262262
commands := []types.Command{
@@ -269,7 +269,7 @@ func TestMergeSketchWithBootloaderPathIsParameterized(t *testing.T) {
269269
NoError(t, err)
270270
}
271271

272-
bytes, err := buildPath.Join("sketch", "sketch.ino.with_bootloader.hex").ReadFile()
272+
bytes, err := buildPath.Join("sketch", "sketch1.ino.with_bootloader.hex").ReadFile()
273273
NoError(t, err)
274274
mergedSketchHex := string(bytes)
275275

0 commit comments

Comments
 (0)