Unverified Commit 95cfd654 authored by Cristian Maglie's avatar Cristian Maglie Committed by GitHub

Allow optional programmer in debug (#2540)

parent 01de174c
......@@ -169,15 +169,14 @@ func getDebugProperties(req *rpc.GetDebugConfigRequest, pme *packagemanager.Expl
}
}
if req.GetProgrammer() == "" {
return nil, &arduino.MissingProgrammerError{}
}
if p, ok := platformRelease.Programmers[req.GetProgrammer()]; ok {
toolProperties.Merge(p.Properties)
} else if refP, ok := referencedPlatformRelease.Programmers[req.GetProgrammer()]; ok {
toolProperties.Merge(refP.Properties)
} else {
return nil, &arduino.ProgrammerNotFoundError{Programmer: req.GetProgrammer()}
if req.GetProgrammer() != "" {
if p, ok := platformRelease.Programmers[req.GetProgrammer()]; ok {
toolProperties.Merge(p.Properties)
} else if refP, ok := referencedPlatformRelease.Programmers[req.GetProgrammer()]; ok {
toolProperties.Merge(refP.Properties)
} else {
return nil, &arduino.ProgrammerNotFoundError{Programmer: req.GetProgrammer()}
}
}
var importPath *paths.Path
......
......@@ -65,12 +65,6 @@ func TestGetCommandLine(t *testing.T) {
pme, release := pm.NewExplorer()
defer release()
{
// Check programmer required
_, err := getCommandLine(req, pme)
require.Error(t, err)
}
{
// Check programmer not found
req.Programmer = "not-existent"
......
......@@ -336,9 +336,6 @@ func testAllDebugInformation(t *testing.T, env *integrationtest.Environment, cli
}
func testDebugCheck(t *testing.T, env *integrationtest.Environment, cli *integrationtest.ArduinoCLI) {
_, _, err := cli.Run("debug", "check", "-b", "arduino:samd:mkr1000")
require.Error(t, err)
out, _, err := cli.Run("debug", "check", "-b", "arduino:samd:mkr1000", "-P", "atmel_ice")
require.NoError(t, err)
require.Contains(t, string(out), "The given board/programmer configuration supports debugging.")
......
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