ARMmbed / mbed-ls

MOVED: https://github.com/ARMmbed/mbed-os-tools (mbedls detects Mbed Enabled devices connected to your computer)
22 stars 89 forks source link

Always checking daplink files to catch older devices #386

Closed bridadan closed 6 years ago

bridadan commented 6 years ago

This would provide an immediate fix for #385, but before this gets merged I think we need to get a full device detection suite in here. It should basically provide mocked information from find_candidates() to list_mbeds() and this should ensure all of them are detected correctly.

coveralls commented 6 years ago

Coverage Status

Coverage increased (+2.0%) to 82.387% when pulling 07babc169ed0340891bca877f62a3233b51f8907 on bridadan:always_check_for_daplink_files into 3c81a02effa839c3fc0e98c8d1d7b7167adb3565 on ARMmbed:master.

bridadan commented 6 years ago

To be clear, please do not merge this yet. I'd like to get a test suite in here first.

bridadan commented 6 years ago

Ok, I've added a new set of tests that ensure the important data points don't change for a list of boards. This isn't exhaustive at the moment, but we should expand this test as we add more firmware support or as we find more corner cases.

@theotherjimmy This is ready for review now. I think the test cases should be pretty uncontroversal, but I would like your opinion on the commit "Always checking daplink files to catch older devices". Thanks!

bridadan commented 6 years ago

Oh also if we break the platform detection, this is what the test results look like:

$ py -2 setup.py test -s test.platform_detection.PlatformDetectionTestCase
running test
running egg_info
writing requirements to mbed_ls.egg-info\requires.txt
writing mbed_ls.egg-info\PKG-INFO
writing top-level names to mbed_ls.egg-info\top_level.txt
writing dependency_links to mbed_ls.egg-info\dependency_links.txt
writing entry points to mbed_ls.egg-info\entry_points.txt
reading manifest file 'mbed_ls.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'mbed_ls.egg-info\SOURCES.txt'
running build_ext
test_EFM32PG_STK3401_jlink (test.platform_detection.PlatformDetectionTestCase) ... FAIL

======================================================================
FAIL: test_EFM32PG_STK3401_jlink (test.platform_detection.PlatformDetectionTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "c:\users\bridan01\onedrive_arm\documents\dev\mbed-ls\test\platform_detection.py", line 127, in test_EFM32PG_STK3401_jlink
    'target_id_mbed_htm': '2035022D000122D5D475113A'
  File "c:\users\bridan01\onedrive_arm\documents\dev\mbed-ls\test\platform_detection.py", line 113, in run_test
    self.assertTrue(False, assert_string)
AssertionError: Expected data mismatch:

{
    "platform_name": "None" (expected "EFM32PG_STK3401")
    "target_id": "000440074453" (expected "2035022D000122D5D475113A")
    "target_id_mbed_htm": "None" (expected "2035022D000122D5D475113A")
}

----------------------------------------------------------------------
Ran 1 test in 0.003s

FAILED (failures=1)