tests: gadget-zero: run against all attached targets
Less command line arguments, more automatic "do what I mean"
This commit is contained in:
@@ -10,6 +10,8 @@ import unittest
|
||||
VENDOR_ID=0xcafe
|
||||
PRODUCT_ID=0xcafe
|
||||
|
||||
# you only need to worry about these if you are trying to explicitly test
|
||||
# a single target. Normally, the test will autofind the attached target
|
||||
#DUT_SERIAL = "stm32f429i-disco"
|
||||
DUT_SERIAL = "stm32f4disco"
|
||||
#DUT_SERIAL = "stm32f103-generic"
|
||||
@@ -385,5 +387,12 @@ class TestUnaligned(unittest.TestCase):
|
||||
if __name__ == "__main__":
|
||||
if len(sys.argv) > 1:
|
||||
DUT_SERIAL = sys.argv.pop()
|
||||
print("Running tests for DUT: ", DUT_SERIAL)
|
||||
unittest.main()
|
||||
print("Running tests for DUT: ", DUT_SERIAL)
|
||||
unittest.main()
|
||||
else:
|
||||
# scan for available and try them all!
|
||||
devs = usb.core.find(idVendor=VENDOR_ID, idProduct=PRODUCT_ID, find_all=True)
|
||||
for dev in devs:
|
||||
DUT_SERIAL = dev.serial_number
|
||||
print("Running tests for DUT: ", DUT_SERIAL)
|
||||
unittest.main(exit=False)
|
||||
|
||||
Reference in New Issue
Block a user