@@ -33,13 +33,16 @@ func TestDebug(t *testing.T) {
33
33
require .NoError (t , err )
34
34
35
35
// Install cores
36
+ _ , _ , err = cli .Run ("core" , "install" , "arduino:avr" )
37
+ require .NoError (t , err )
36
38
_ , _ , err = cli .Run ("core" , "install" , "arduino:samd" )
37
39
require .NoError (t , err )
38
40
39
41
integrationtest.CLISubtests {
40
42
{"Start" , testDebuggerStarts },
41
43
{"WithPdeSketchStarts" , testDebuggerWithPdeSketchStarts },
42
44
{"DebugInformation" , testAllDebugInformation },
45
+ {"DebugCheck" , testDebugCheck },
43
46
}.Run (t , env , cli )
44
47
}
45
48
@@ -331,3 +334,24 @@ func testAllDebugInformation(t *testing.T, env *integrationtest.Environment, cli
331
334
}
332
335
}
333
336
}
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