@@ -106,13 +106,12 @@ func testAllDebugInformation(t *testing.T, env *integrationtest.Environment, cli
106106 require .NoError (t , err )
107107
108108 // Build sketch
109- fqbn := "my:samd:my"
110- _ , _ , err = cli .Run ("compile" , "-b" , fqbn , sketchPath .String (), "--format" , "json" )
109+ _ , _ , err = cli .Run ("compile" , "-b" , "my:samd:my" , sketchPath .String (), "--format" , "json" )
111110 require .NoError (t , err )
112111
113112 {
114113 // Starts debugger
115- jsonDebugOut , _ , err := cli .Run ("debug" , "-b" , fqbn , "-P" , "atmel_ice" , sketchPath .String (), "--info" , "--format" , "json" )
114+ jsonDebugOut , _ , err := cli .Run ("debug" , "-b" , "my:samd:my" , "-P" , "atmel_ice" , sketchPath .String (), "--info" , "--format" , "json" )
116115 require .NoError (t , err )
117116 debugOut := requirejson .Parse (t , jsonDebugOut )
118117 debugOut .MustContain (`
@@ -128,7 +127,8 @@ func testAllDebugInformation(t *testing.T, env *integrationtest.Environment, cli
128127 "scripts": [
129128 "first",
130129 "second",
131- "third"
130+ "third",
131+ "fourth"
132132 ]
133133 },
134134 "svd_file": "svd-file",
@@ -153,7 +153,7 @@ func testAllDebugInformation(t *testing.T, env *integrationtest.Environment, cli
153153
154154 // Starts debugger with another programmer
155155 {
156- jsonDebugOut , _ , err := cli .Run ("debug" , "-b" , fqbn , "-P" , "my_cold_ice" , sketchPath .String (), "--info" , "--format" , "json" )
156+ jsonDebugOut , _ , err := cli .Run ("debug" , "-b" , "my:samd:my" , "-P" , "my_cold_ice" , sketchPath .String (), "--info" , "--format" , "json" )
157157 require .NoError (t , err )
158158 debugOut := requirejson .Parse (t , jsonDebugOut )
159159 debugOut .MustContain (`
@@ -169,7 +169,8 @@ func testAllDebugInformation(t *testing.T, env *integrationtest.Environment, cli
169169 "scripts": [
170170 "first",
171171 "second",
172- "cold_ice_script"
172+ "cold_ice_script",
173+ "fourth"
173174 ]
174175 },
175176 "svd_file": "svd-file",
@@ -190,5 +191,52 @@ func testAllDebugInformation(t *testing.T, env *integrationtest.Environment, cli
190191 ]
191192 }
192193 }` )
194+
195+ {
196+ // Starts debugger with an old-style openocd script definition
197+ jsonDebugOut , _ , err := cli .Run ("debug" , "-b" , "my:samd:my2" , "-P" , "atmel_ice" , sketchPath .String (), "--info" , "--format" , "json" )
198+ require .NoError (t , err )
199+ debugOut := requirejson .Parse (t , jsonDebugOut )
200+ debugOut .MustContain (`
201+ {
202+ "toolchain": "gcc",
203+ "toolchain_path": "gcc-path",
204+ "toolchain_prefix": "gcc-prefix",
205+ "server": "openocd",
206+ "server_path": "openocd-path",
207+ "server_configuration": {
208+ "path": "openocd-path",
209+ "scripts_dir": "openocd-scripts-dir",
210+ "scripts": [
211+ "single-script"
212+ ]
213+ },
214+ "svd_file": "svd-file"
215+ }` )
216+ }
217+
218+ {
219+ // Starts debugger with mixed old and new-style openocd script definition
220+ jsonDebugOut , _ , err := cli .Run ("debug" , "-b" , "my:samd:my2" , "-P" , "my_cold_ice" , sketchPath .String (), "--info" , "--format" , "json" )
221+ require .NoError (t , err )
222+ debugOut := requirejson .Parse (t , jsonDebugOut )
223+ debugOut .MustContain (`
224+ {
225+ "toolchain": "gcc",
226+ "toolchain_path": "gcc-path",
227+ "toolchain_prefix": "gcc-prefix",
228+ "server": "openocd",
229+ "server_path": "openocd-path",
230+ "server_configuration": {
231+ "path": "openocd-path",
232+ "scripts_dir": "openocd-scripts-dir",
233+ "scripts": [
234+ "cold_ice_script"
235+ ]
236+ },
237+ "svd_file": "svd-file"
238+ }` )
239+ }
240+
193241 }
194242}
0 commit comments