Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add local yotta targets scan for mbed-target keywords #42

Merged
merged 5 commits into from
Dec 8, 2015

Conversation

PrzemekWirkus
Copy link
Contributor

Description

Currently we are suing yotta search command to check for compatible with connected device yotta targets.
New functionality uses locally stored yotta targets (mymodule/yotta_targets directory) to do so and allows user to add yotta registry results with new command line switch --yotta-registry.

This method is much faster than yotta registry queries and allows users to work and test off-line !

This PR is solving #37.

Example usage with this change

$ mbedgt -V --config
mbedgt: checking for yotta target in current directory
        reason: no --target switch set
mbedgt: checking yotta target in current directory
        calling yotta: yotta --plain target
mbedgt: assuming default target as 'frdm-k64f-gcc'
mbedgt: detecting connected mbed-enabled devices...
mbedgt: detected 2 devices
        detected 'K64F' -> 'K64F[0]', console at 'COM176', mounted at 'E:', target id '0240020152A06E54AF5E93EC'
        detected 'K64F' -> 'K64F[1]', console at 'COM172', mounted at 'G:', target id '0240022648cb1e77000000000000000000000000b512e3cf'
mbedgt: local yotta target search in './yotta_targets' for compatible mbed-target 'k64f'
        inside './yotta_targets\frdm-k64f-armcc' found compatible target 'frdm-k64f-armcc'
        inside './yotta_targets\frdm-k64f-gcc' found compatible target 'frdm-k64f-gcc'
mbedgt: processing 'frdm-k64f-gcc' yotta target compatible platforms...
mbedgt: processing 'K64F' platform...
mbedgt: using platform 'K64F' for test:
        target_id_mbed_htm = '0240020152A06E54AF5E93EC'
        mount_point = 'E:'
        target_id = '0240020152A06E54AF5E93EC'
        serial_port = 'COM176'
        target_id_usb_id = '0240020152A06E54AF5E93EC'
        platform_name = 'K64F'
        platform_name_unique = 'K64F[0]'
        use 0 instances for testing

Example: execute 'mbedgt --target=TARGET_NAME' to start testing for TARGET_NAME target
completed in 1.01 sec

Example with --yotta-registry

$ mbedgt -V --config --yotta-registry
mbedgt: checking for yotta target in current directory
        reason: no --target switch set
mbedgt: checking yotta target in current directory
        calling yotta: yotta --plain target
mbedgt: assuming default target as 'frdm-k64f-gcc'
mbedgt: detecting connected mbed-enabled devices...
mbedgt: detected 2 devices
        detected 'K64F' -> 'K64F[0]', console at 'COM176', mounted at 'E:', target id '0240020152A06E54AF5E93EC'
        detected 'K64F' -> 'K64F[1]', console at 'COM172', mounted at 'G:', target id '0240022648cb1e77000000000000000000000000b512e3cf'
mbedgt: local yotta target search in './yotta_targets' for compatible mbed-target 'k64f'
        inside './yotta_targets\frdm-k64f-armcc' found compatible target 'frdm-k64f-armcc'
        inside './yotta_targets\frdm-k64f-gcc' found compatible target 'frdm-k64f-gcc'
mbedgt: yotta search for mbed-target 'k64f'
        calling yotta: yotta --plain search -k mbed-target:k64f target
        found target 'frdm-k64f-gcc'
        found target 'frdm-k64f-armcc'
mbedgt: processing 'frdm-k64f-gcc' yotta target compatible platforms...
mbedgt: processing 'K64F' platform...
mbedgt: using platform 'K64F' for test:
        target_id_mbed_htm = '0240020152A06E54AF5E93EC'
        mount_point = 'E:'
        target_id = '0240020152A06E54AF5E93EC'
        serial_port = 'COM176'
        target_id_usb_id = '0240020152A06E54AF5E93EC'
        platform_name = 'K64F'
        platform_name_unique = 'K64F[0]'
        use 0 instances for testing

Example: execute 'mbedgt --target=TARGET_NAME' to start testing for TARGET_NAME target
completed in 5.02 sec

@PrzemekWirkus
Copy link
Contributor Author

Test results:

python setup.py test
running test
running egg_info
writing pbr to mbed_greentea.egg-info\pbr.json
writing requirements to mbed_greentea.egg-info\requires.txt
writing mbed_greentea.egg-info\PKG-INFO
writing top-level names to mbed_greentea.egg-info\top_level.txt
writing dependency_links to mbed_greentea.egg-info\dependency_links.txt
writing entry points to mbed_greentea.egg-info\entry_points.txt
reading manifest file 'mbed_greentea.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'mbed_greentea.egg-info\SOURCES.txt'
running build_ext
test_example (test.basic.BasicTestCase) ... ok
test_print_version (test.mbed_gt_cli.GreenteaCliFunctionality) ... ok
test_example (test.mbed_gt_cmake_handlers.GreenteaCmakeHandlers) ... ok
test_parse_ctesttestfile_line (test.mbed_gt_cmake_handlers.GreenteaCmakeHandlers) ... ok
test_parse_mbed_target_from_target_json (test.mbed_gt_target_info.GreenteaTargetInfo) ... ok
test_parse_mbed_target_from_target_json_multiple (test.mbed_gt_target_info.GreenteaTargetInfo) ... ok
test_parse_yotta_search_cmd_output (test.mbed_gt_target_info.GreenteaTargetInfo) ... ok
test_parse_yotta_search_cmd_output_new_style (test.mbed_gt_target_info.GreenteaTargetInfo) ... ok
test_parse_yotta_search_cmd_output_new_style_text (test.mbed_gt_target_info.GreenteaTargetInfo) ... ok
test_parse_yotta_search_cmd_output_new_style_text_2 (test.mbed_gt_target_info.GreenteaTargetInfo) ... ok
test_parse_yotta_search_cmd_output_text (test.mbed_gt_target_info.GreenteaTargetInfo) ... ok
test_parse_yotta_search_cmd_output_with_ssl_errors (test.mbed_gt_target_info.GreenteaTargetInfo) ... ok
test_parse_yotta_target_cmd_output (test.mbed_gt_target_info.GreenteaTargetInfo) ... ok
test_parse_yotta_target_cmd_output_mixed_chars (test.mbed_gt_target_info.GreenteaTargetInfo) ... ok
test_parse_yotta_target_cmd_output_mixed_nl (test.mbed_gt_target_info.GreenteaTargetInfo) ... ok
test_parse_yotta_target_cmd_output_mixed_nl_whitechars (test.mbed_gt_target_info.GreenteaTargetInfo) ... ok
test_parse_yotta_target_cmd_output_mixed_rcnl (test.mbed_gt_target_info.GreenteaTargetInfo) ... ok
test_parse_yotta_target_cmd_output_mixed_rcnl_whitechars (test.mbed_gt_target_info.GreenteaTargetInfo) ... ok
test_parse_yotta_target_cmd_output_mixed_version (test.mbed_gt_target_info.GreenteaTargetInfo) ... ok
test_parse_yotta_target_cmd_output_mixed_whitechars (test.mbed_gt_target_info.GreenteaTargetInfo) ... ok
test_get_test_result (test.mbed_gt_test_api.GreenteaTestAPI) ... ok
test_get_baudrate_38400 (test.mbed_gt_yotta_config.YOttaConfigurationParse) ... ok
test_get_baudrate_9600 (test.mbed_gt_yotta_config.YOttaConfigurationParse) ... ok
test_get_baudrate_None (test.mbed_gt_yotta_config.YOttaConfigurationParse) ... ok
test_get_baudrate_default_115200 (test.mbed_gt_yotta_config.YOttaConfigurationParse) ... ok
test_get_baudrate_default_115200_no_yotta_config (test.mbed_gt_yotta_config.YOttaConfigurationParse) ... ok
test_get_test_pins (test.mbed_gt_yotta_config.YOttaConfigurationParse) ... ok

----------------------------------------------------------------------
Ran 28 tests in 1.090s

OK

@0xc0170
Copy link

0xc0170 commented Dec 8, 2015

Is --yotta_search the right name? Because even without this argument, we are checking yotta folder. --yotta_search checks registry, thus --yotta-registry would be better? Do we need this switch thought? For instance we could do - check local targets, then online registry (if we connect to the registry).

@PrzemekWirkus
Copy link
Contributor Author

@0xc0170 Yes, you are right! I will change name to --yotta-registry :) Thank you! 👍

PrzemekWirkus added a commit that referenced this pull request Dec 8, 2015
Add local yotta targets scan for mbed-target keywords
@PrzemekWirkus PrzemekWirkus merged commit 7802378 into master Dec 8, 2015
@PrzemekWirkus PrzemekWirkus deleted the devel_local_yt_target_scan branch December 10, 2015 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants