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 yotta config parse #41

Merged
merged 5 commits into from
Dec 8, 2015
Merged

Add yotta config parse #41

merged 5 commits into from
Dec 8, 2015

Conversation

PrzemekWirkus
Copy link
Contributor

Changes

  • Add yotta_config.json parsing support.
    • yotta_config::mbed-os::stdio::default-baud setting read.
  • Change dafault yotta connfiguration baudrate (default-baud) to 115200.

Example yotta configuration with baudrate

{
  "minar": {
    "initial_event_pool_size": 50,
    "additional_event_pools_size": 100
  },
  "mbed-os": {
    "net": {
      "stacks": {
        "lwip": true
      }
    },
    "stdio": {
      "default-baud": 9600
    }
  },
}

Dependencies

This feature is using extended port configuration in mbed-host-tests

Implications

mbedhtrun will be called with a baudrate added to serial port command line switch, here -p COM172:9600:

mbedhtrun -d G: -p COM172:9600 -f ".\core-util-test-functionpointer.bin" -C 4 -c shell -m K64F

See example call for one host test execution:

mbedgt: mbed-host-test-runner: stopped
mbedgt: mbed-host-test-runner: returned 'OK'
mbedgt: test on hardware with target id: 0240022648cb1e77000000000000000000000000b512e3cf
        test 'core-util-test-eventhandler' ..................................................... OK in 6.75 sec
mbedgt: selecting test case observer...
        calling mbedhtrun: mbedhtrun -d G: -p COM172:9600 -f ".\core-util-test-functionpointer.bin" -C 4 -c shell -m K64F
mbedgt: mbed-host-test-runner: started
MBED: Instrumentation: "COM172" and disk: "G:"
HOST: Copy image onto target...
        1 file(s) copied.
HOST: Initialize serial port...
...port ready!
HOST: Reset target...
HOST: Detecting test case properties...
HOST: Error! No host test name defined in preamble

{{error}}
{{end}}

@@ -42,7 +42,7 @@
from mbed_greentea.mbed_greentea_dlm import greentea_update_kettle
from mbed_greentea.mbed_greentea_dlm import greentea_clean_kettle
from mbed_greentea.mbed_yotta_api import build_with_yotta

from mbed_yotta_target_parse import YottaConfig
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this using different paths than the imports above? (rel/abs)

@0xc0170
Copy link

0xc0170 commented Dec 8, 2015

tests for YottaConfig ?

@PrzemekWirkus
Copy link
Contributor Author

Unit test results:

[yotta_config_parse] C:\Work\p\greentea> 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_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 26 tests in 2.116s

OK

@0xc0170
Copy link

0xc0170 commented Dec 8, 2015

LGTM

PrzemekWirkus added a commit that referenced this pull request Dec 8, 2015
Add yotta config parse functionality
@PrzemekWirkus PrzemekWirkus merged commit 52466e2 into master Dec 8, 2015
@PrzemekWirkus PrzemekWirkus deleted the yotta_config_parse branch December 10, 2015 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants