@@ -21,6 +21,7 @@ import (
21
21
"strings"
22
22
"testing"
23
23
24
+ "github.com/arduino/arduino-cli/arduino/builder"
24
25
"github.com/arduino/arduino-cli/arduino/cores"
25
26
"github.com/arduino/arduino-cli/arduino/cores/packagemanager"
26
27
"github.com/arduino/arduino-cli/arduino/sketches"
@@ -76,15 +77,14 @@ func TestDetermineBuildPathAndSketchName(t *testing.T) {
76
77
{"" , "testdata/build_path_2" , nil , nil , "testdata/build_path_2" , "Blink.ino" },
77
78
// 03: error: used both importPath and importFile
78
79
{"testdata/build_path_2/Blink.ino.hex" , "testdata/build_path_2" , nil , nil , "<nil>" , "" },
79
- // 04: error: only sketch without FQBN
80
- {"" , "" , blonk , nil , "<nil>" , "" },
80
+ // 04: only sketch without FQBN
81
+ {"" , "" , blonk , nil , builder . GenBuildPath ( blonk . FullPath ). String () , "Blonk.ino " },
81
82
// 05: use importFile to detect build.path and project_name, sketch is ignored.
82
83
{"testdata/build_path_2/Blink.ino.hex" , "" , blonk , nil , "testdata/build_path_2" , "Blink.ino" },
83
84
// 06: use importPath as build.path and Blink as project name, ignore the sketch Blonk
84
85
{"" , "testdata/build_path_2" , blonk , nil , "testdata/build_path_2" , "Blink.ino" },
85
86
// 07: error: used both importPath and importFile
86
87
{"testdata/build_path_2/Blink.ino.hex" , "testdata/build_path_2" , blonk , nil , "<nil>" , "" },
87
-
88
88
// 08: error: no data passed in
89
89
{"" , "" , nil , fqbn , "<nil>" , "" },
90
90
// 09: use importFile to detect build.path and project_name, fqbn ignored
@@ -94,14 +94,13 @@ func TestDetermineBuildPathAndSketchName(t *testing.T) {
94
94
// 11: error: used both importPath and importFile
95
95
{"testdata/build_path_2/Blink.ino.hex" , "testdata/build_path_2" , nil , fqbn , "<nil>" , "" },
96
96
// 12: use sketch to determine project name and sketch+fqbn to determine build path
97
- {"" , "" , blonk , fqbn , "testdata/Blonk/build/arduino.samd.mkr1000" , "Blonk.ino" },
97
+ {"" , "" , blonk , fqbn , builder . GenBuildPath ( blonk . FullPath ). String () , "Blonk.ino" },
98
98
// 13: use importFile to detect build.path and project_name, sketch+fqbn is ignored.
99
99
{"testdata/build_path_2/Blink.ino.hex" , "" , blonk , fqbn , "testdata/build_path_2" , "Blink.ino" },
100
100
// 14: use importPath as build.path and Blink as project name, ignore the sketch Blonk, ignore fqbn
101
101
{"" , "testdata/build_path_2" , blonk , fqbn , "testdata/build_path_2" , "Blink.ino" },
102
102
// 15: error: used both importPath and importFile
103
103
{"testdata/build_path_2/Blink.ino.hex" , "testdata/build_path_2" , blonk , fqbn , "<nil>" , "" },
104
-
105
104
// 16: importPath containing multiple firmwares, but one has the same name as the containing folder
106
105
{"" , "testdata/firmware" , nil , fqbn , "testdata/firmware" , "firmware.ino" },
107
106
// 17: importFile among multiple firmwares
0 commit comments