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