Skip to content

Commit 69327ad

Browse files
committed
added integration test
1 parent 4d59516 commit 69327ad

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

internal/integrationtest/debug/debug_test.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,16 @@ func TestDebug(t *testing.T) {
3333
require.NoError(t, err)
3434

3535
// Install cores
36+
_, _, err = cli.Run("core", "install", "arduino:avr")
37+
require.NoError(t, err)
3638
_, _, err = cli.Run("core", "install", "arduino:samd")
3739
require.NoError(t, err)
3840

3941
integrationtest.CLISubtests{
4042
{"Start", testDebuggerStarts},
4143
{"WithPdeSketchStarts", testDebuggerWithPdeSketchStarts},
4244
{"DebugInformation", testAllDebugInformation},
45+
{"DebugCheck", testDebugCheck},
4346
}.Run(t, env, cli)
4447
}
4548

@@ -331,3 +334,24 @@ func testAllDebugInformation(t *testing.T, env *integrationtest.Environment, cli
331334
}
332335
}
333336
}
337+
338+
func testDebugCheck(t *testing.T, env *integrationtest.Environment, cli *integrationtest.ArduinoCLI) {
339+
_, _, err := cli.Run("debug", "check", "-b", "arduino:samd:mkr1000")
340+
require.Error(t, err)
341+
342+
out, _, err := cli.Run("debug", "check", "-b", "arduino:samd:mkr1000", "-P", "atmel_ice")
343+
require.NoError(t, err)
344+
require.Contains(t, string(out), "The given board/programmer configuration supports debugging.")
345+
346+
out, _, err = cli.Run("debug", "check", "-b", "arduino:samd:mkr1000", "-P", "atmel_ice", "--format", "json")
347+
require.NoError(t, err)
348+
requirejson.Query(t, out, `.supported`, `true`)
349+
350+
out, _, err = cli.Run("debug", "check", "-b", "arduino:avr:uno", "-P", "atmel_ice")
351+
require.NoError(t, err)
352+
require.Contains(t, string(out), "The given board/programmer configuration does NOT support debugging.")
353+
354+
out, _, err = cli.Run("debug", "check", "-b", "arduino:avr:uno", "-P", "atmel_ice", "--format", "json")
355+
require.NoError(t, err)
356+
requirejson.Query(t, out, `.supported`, `false`)
357+
}

0 commit comments

Comments
 (0)