@@ -106,13 +106,12 @@ func testAllDebugInformation(t *testing.T, env *integrationtest.Environment, cli
106
106
require .NoError (t , err )
107
107
108
108
// 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" )
111
110
require .NoError (t , err )
112
111
113
112
{
114
113
// 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" )
116
115
require .NoError (t , err )
117
116
debugOut := requirejson .Parse (t , jsonDebugOut )
118
117
debugOut .MustContain (`
@@ -128,7 +127,8 @@ func testAllDebugInformation(t *testing.T, env *integrationtest.Environment, cli
128
127
"scripts": [
129
128
"first",
130
129
"second",
131
- "third"
130
+ "third",
131
+ "fourth"
132
132
]
133
133
},
134
134
"svd_file": "svd-file",
@@ -153,7 +153,7 @@ func testAllDebugInformation(t *testing.T, env *integrationtest.Environment, cli
153
153
154
154
// Starts debugger with another programmer
155
155
{
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" )
157
157
require .NoError (t , err )
158
158
debugOut := requirejson .Parse (t , jsonDebugOut )
159
159
debugOut .MustContain (`
@@ -169,7 +169,8 @@ func testAllDebugInformation(t *testing.T, env *integrationtest.Environment, cli
169
169
"scripts": [
170
170
"first",
171
171
"second",
172
- "cold_ice_script"
172
+ "cold_ice_script",
173
+ "fourth"
173
174
]
174
175
},
175
176
"svd_file": "svd-file",
@@ -190,5 +191,52 @@ func testAllDebugInformation(t *testing.T, env *integrationtest.Environment, cli
190
191
]
191
192
}
192
193
}` )
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
+
193
241
}
194
242
}
0 commit comments