@@ -156,3 +156,98 @@ func TestBoardListallWithManuallyInstalledPlatform(t *testing.T) {
156
156
]
157
157
}` )
158
158
}
159
+
160
+ func TestBoardDetails (t * testing.T ) {
161
+ env , cli := integrationtest .CreateArduinoCLIWithEnvironment (t )
162
+ defer env .CleanUp ()
163
+
164
+ _ , _ , err := cli .Run ("core" , "update-index" )
165
+ require .NoError (t , err )
166
+ // Download samd core pinned to 1.8.6
167
+ _ ,
_ ,
err = cli .
Run (
"core" ,
"install" ,
"arduino:[email protected] " )
168
+ require .NoError (t , err )
169
+
170
+ // Test board listall with and without showing hidden elements
171
+ stdout , _ , err := cli .Run ("board" , "listall" , "MIPS" , "--format" , "json" )
172
+ require .NoError (t , err )
173
+ require .Equal (t , string (stdout ), "{}\n " )
174
+
175
+ stdout , _ , err = cli .Run ("board" , "listall" , "MIPS" , "-a" , "--format" , "json" )
176
+ require .NoError (t , err )
177
+ requirejson .Contains (t , stdout , `{
178
+ "boards": [
179
+ {
180
+ "name": "Arduino Tian (MIPS Console port)"
181
+ }
182
+ ]
183
+ }` )
184
+
185
+ stdout , _ , err = cli .Run ("board" , "details" , "-b" , "arduino:samd:nano_33_iot" , "--format" , "json" )
186
+ require .NoError (t , err )
187
+
188
+ requirejson .Contains (t , stdout , `{
189
+ "fqbn": "arduino:samd:nano_33_iot",
190
+ "name": "Arduino NANO 33 IoT",
191
+ "version": "1.8.6",
192
+ "properties_id": "nano_33_iot",
193
+ "official": true,
194
+ "package": {
195
+ "maintainer": "Arduino",
196
+ "url": "https://downloads.arduino.cc/packages/package_index.tar.bz2",
197
+ "website_url": "http://www.arduino.cc/",
198
+
199
+ "name": "arduino",
200
+ "help": {
201
+ "online": "http://www.arduino.cc/en/Reference/HomePage"
202
+ }
203
+ },
204
+ "platform": {
205
+ "architecture": "samd",
206
+ "category": "Arduino",
207
+ "url": "http://downloads.arduino.cc/cores/samd-1.8.6.tar.bz2",
208
+ "archive_filename": "samd-1.8.6.tar.bz2",
209
+ "checksum": "SHA-256:68a4fffa6fe6aa7886aab2e69dff7d3f94c02935bbbeb42de37f692d7daf823b",
210
+ "size": 2980953,
211
+ "name": "Arduino SAMD Boards (32-bits ARM Cortex-M0+)"
212
+ },
213
+ "identification_properties": [
214
+ {
215
+ "properties": {
216
+ "vid": "0x2341",
217
+ "pid": "0x8057"
218
+ }
219
+ },
220
+ {
221
+ "properties": {
222
+ "vid": "0x2341",
223
+ "pid": "0x0057"
224
+ }
225
+ }
226
+ ],
227
+ "programmers": [
228
+ {
229
+ "platform": "Arduino SAMD Boards (32-bits ARM Cortex-M0+)",
230
+ "id": "edbg",
231
+ "name": "Atmel EDBG"
232
+ },
233
+ {
234
+ "platform": "Arduino SAMD Boards (32-bits ARM Cortex-M0+)",
235
+ "id": "atmel_ice",
236
+ "name": "Atmel-ICE"
237
+ },
238
+ {
239
+ "platform": "Arduino SAMD Boards (32-bits ARM Cortex-M0+)",
240
+ "id": "sam_ice",
241
+ "name": "Atmel SAM-ICE"
242
+ }
243
+ ]
244
+ }` )
245
+
246
+ // Download samd core pinned to 1.8.8
247
+ _ ,
_ ,
err = cli .
Run (
"core" ,
"install" ,
"arduino:[email protected] " )
248
+ require .NoError (t , err )
249
+
250
+ stdout , _ , err = cli .Run ("board" , "details" , "-b" , "arduino:samd:nano_33_iot" , "--format" , "json" )
251
+ require .NoError (t , err )
252
+ requirejson .Contains (t , stdout , `{"debugging_supported": true}` )
253
+ }
0 commit comments