@@ -21,6 +21,7 @@ import (
2121 "strings"
2222 "testing"
2323
24+ "github.com/arduino/arduino-cli/arduino/builder"
2425 "github.com/arduino/arduino-cli/arduino/cores"
2526 "github.com/arduino/arduino-cli/arduino/cores/packagemanager"
2627 "github.com/arduino/arduino-cli/arduino/sketches"
@@ -76,15 +77,14 @@ func TestDetermineBuildPathAndSketchName(t *testing.T) {
7677 {"" , "testdata/build_path_2" , nil , nil , "testdata/build_path_2" , "Blink.ino" },
7778 // 03: error: used both importPath and importFile
7879 {"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 " },
8182 // 05: use importFile to detect build.path and project_name, sketch is ignored.
8283 {"testdata/build_path_2/Blink.ino.hex" , "" , blonk , nil , "testdata/build_path_2" , "Blink.ino" },
8384 // 06: use importPath as build.path and Blink as project name, ignore the sketch Blonk
8485 {"" , "testdata/build_path_2" , blonk , nil , "testdata/build_path_2" , "Blink.ino" },
8586 // 07: error: used both importPath and importFile
8687 {"testdata/build_path_2/Blink.ino.hex" , "testdata/build_path_2" , blonk , nil , "<nil>" , "" },
87-
8888 // 08: error: no data passed in
8989 {"" , "" , nil , fqbn , "<nil>" , "" },
9090 // 09: use importFile to detect build.path and project_name, fqbn ignored
@@ -94,14 +94,13 @@ func TestDetermineBuildPathAndSketchName(t *testing.T) {
9494 // 11: error: used both importPath and importFile
9595 {"testdata/build_path_2/Blink.ino.hex" , "testdata/build_path_2" , nil , fqbn , "<nil>" , "" },
9696 // 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" },
9898 // 13: use importFile to detect build.path and project_name, sketch+fqbn is ignored.
9999 {"testdata/build_path_2/Blink.ino.hex" , "" , blonk , fqbn , "testdata/build_path_2" , "Blink.ino" },
100100 // 14: use importPath as build.path and Blink as project name, ignore the sketch Blonk, ignore fqbn
101101 {"" , "testdata/build_path_2" , blonk , fqbn , "testdata/build_path_2" , "Blink.ino" },
102102 // 15: error: used both importPath and importFile
103103 {"testdata/build_path_2/Blink.ino.hex" , "testdata/build_path_2" , blonk , fqbn , "<nil>" , "" },
104-
105104 // 16: importPath containing multiple firmwares, but one has the same name as the containing folder
106105 {"" , "testdata/firmware" , nil , fqbn , "testdata/firmware" , "firmware.ino" },
107106 // 17: importFile among multiple firmwares
0 commit comments