Closed bridadan closed 6 years ago
To be clear, please do not merge this yet. I'd like to get a test suite in here first.
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!
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)
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()
tolist_mbeds()
and this should ensure all of them are detected correctly.