@@ -26,14 +26,16 @@ import (
26
26
dbg "github.com/arduino/arduino-cli/rpc/debug"
27
27
"github.com/arduino/go-paths-helper"
28
28
"github.com/stretchr/testify/assert"
29
+ "github.com/stretchr/testify/require"
29
30
)
30
31
31
- var customHardware = paths .New ("testdata" , "custom_hardware" )
32
- var dataDir = paths .New ("testdata" , "data_dir" , "packages" )
33
- var sketch = "hello"
34
- var sketchPath = paths .New ("testdata" , sketch )
35
-
36
32
func TestGetCommandLine (t * testing.T ) {
33
+ customHardware := paths .New ("testdata" , "custom_hardware" )
34
+ dataDir := paths .New ("testdata" , "data_dir" , "packages" )
35
+ sketch := "hello"
36
+ sketchPath := paths .New ("testdata" , sketch )
37
+ require .NoError (t , sketchPath .ToAbs ())
38
+
37
39
pm := packagemanager .NewPackageManager (nil , nil , nil , nil )
38
40
pm .LoadHardwareFromDirectory (customHardware )
39
41
pm .LoadHardwareFromDirectory (dataDir )
@@ -59,9 +61,9 @@ func TestGetCommandLine(t *testing.T) {
59
61
fmt .Sprintf (" -c \" gdb_port pipe\" -c \" telnet_port 0\" -c init -c halt %s/build/arduino-test.samd.arduino_zero_edbg/hello.ino.elf" , sketchPath )
60
62
61
63
command , err := getCommandLine (req , pm )
62
- assert .Nil (t , err )
64
+ require .Nil (t , err )
63
65
commandToTest := strings .Join (command [:], " " )
64
- assert .Equal (t , filepath .FromSlash (goldCommand ), filepath .FromSlash (commandToTest ))
66
+ require .Equal (t , filepath .FromSlash (goldCommand ), filepath .FromSlash (commandToTest ))
65
67
66
68
// Other samd boards such as mkr1000 can be debugged using an external tool such as Atmel ICE connected to
67
69
// the board debug port
@@ -83,5 +85,4 @@ func TestGetCommandLine(t *testing.T) {
83
85
assert .Nil (t , err )
84
86
commandToTest2 := strings .Join (command2 [:], " " )
85
87
assert .Equal (t , filepath .FromSlash (goldCommand2 ), filepath .FromSlash (commandToTest2 ))
86
-
87
88
}
0 commit comments