42
42
"vmware_desktop" ,
43
43
)
44
44
45
+ # List of microTVM platforms for testing.
46
+ ALL_MICROTVM_PLATFORMS = (
47
+ "stm32f746xx" ,
48
+ "nrf5340dk" ,
49
+ )
50
+
45
51
46
52
def parse_virtualbox_devices ():
47
53
output = subprocess .check_output (["VBoxManage" , "list" , "usbhost" ], encoding = "utf-8" )
@@ -109,6 +115,7 @@ def attach_virtualbox(uuid, vid_hex=None, pid_hex=None, serial=None):
109
115
if serial is not None :
110
116
rule_args .extend (["--serialnumber" , serial ])
111
117
subprocess .check_call (rule_args )
118
+ # TODO(mehrdadh): skip usb attach if it's already attached
112
119
subprocess .check_call (["VBoxManage" , "controlvm" , uuid , "usbattach" , dev ["UUID" ]])
113
120
return
114
121
@@ -308,13 +315,17 @@ def test_command(args):
308
315
test_config_file = os .path .join (base_box_dir , "test-config.json" )
309
316
with open (test_config_file ) as f :
310
317
test_config = json .load (f )
318
+
319
+ # select microTVM test platform
320
+ microtvm_test_platform = test_config [args .microtvm_platform ]
321
+
311
322
for key , expected_type in REQUIRED_TEST_CONFIG_KEYS .items ():
312
- assert key in test_config and isinstance (
313
- test_config [key ], expected_type
323
+ assert key in microtvm_test_platform and isinstance (
324
+ microtvm_test_platform [key ], expected_type
314
325
), f"Expected key { key } of type { expected_type } in { test_config_file } : { test_config !r} "
315
326
316
- test_config ["vid_hex" ] = test_config ["vid_hex" ].lower ()
317
- test_config ["pid_hex" ] = test_config ["pid_hex" ].lower ()
327
+ microtvm_test_platform ["vid_hex" ] = microtvm_test_platform ["vid_hex" ].lower ()
328
+ microtvm_test_platform ["pid_hex" ] = microtvm_test_platform ["pid_hex" ].lower ()
318
329
319
330
providers = args .provider
320
331
provider_passed = {p : False for p in providers }
@@ -331,7 +342,7 @@ def test_command(args):
331
342
release_test_dir , user_box_dir , base_box_dir , provider_name
332
343
)
333
344
do_run_release_test (
334
- release_test_dir , provider_name , test_config , args .test_device_serial
345
+ release_test_dir , provider_name , microtvm_test_platform , args .test_device_serial
335
346
)
336
347
provider_passed [provider_name ] = True
337
348
@@ -444,6 +455,13 @@ def parse_args():
444
455
),
445
456
)
446
457
458
+ parser .add_argument (
459
+ "--microtvm-platform" ,
460
+ default = "stm32f746xx" ,
461
+ choices = ALL_MICROTVM_PLATFORMS ,
462
+ help = "For use with 'test' command. MicroTVM platfrom that are used for testing." ,
463
+ )
464
+
447
465
return parser .parse_args ()
448
466
449
467
0 commit comments