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

[devel_transport] Async features #65

Merged
merged 41 commits into from
Mar 2, 2016
Merged

[devel_transport] Async features #65

merged 41 commits into from
Mar 2, 2016

Conversation

PrzemekWirkus
Copy link
Contributor

Description

This changes introduce async htrun features:

  • KiVi - key-value protocol, see: {{key;value}}} protocol.
  • sync message to sync/handshake DUT and host test.
  • Async serial port event queue with callback mappings.
  • Callbacks registration.
  • Ported few host tests to new async:
    • Example: default_auto, echo, hello_auto, rtc_auto and (I think more).

Limitations

This feature is not compatible with Greentea in current state, please use mbedhtrun command separately.

Example usage:

$ git clone <this htrun-branch>
$ cd htrun
$ python setup.py develop

You can build yourself mbed-drivers from corresponding PR.

$ git clone <mbed-drivers devel_greentea>
$ yt target
$ yt build
$ mbedgt --list

Run some test with mbedhtrun (not yet with mbedgt!!!)

$ mbedhtrun -d F: -p COM184:9600 -f ".\build\frdm-k64f-gcc\test\mbed-drivers-test-echo.bin" -C 4 -c shell -m K64F

Where -d F: specifies mount point of your e.g. K64F, serial port -p COM184:9600.

You should see:

$ mbedhtrun ...
[1454445483.33][INF] copy image onto target... SKIPPED!
[1454445483.34][INF] starting host test process...
[1454445483.94][INF] starting connection process...
[1454445483.94][INF] Serial port=COM184 baudrate=9600 program_cycle_s=4
[1454445483.94][INF] reset device (send_break(0.50 sec))
[1454445484.44][INF] wait after flashing (sleep(4.00 sec))
[1454445488.45][INF] sending preamble 'd238e9ec-65d4-4b60-a141-a1e146578319'...
[1454445488.65][RXD] {{sync;d238e9ec-65d4-4b60-a141-a1e146578319}}
[1454445488.65][RXD] {{timeout;15}}
[1454445488.65][RXD] {{host_test_name;echo}}
[1454445488.65][INF] found KV pair in stream: {{sync;d238e9ec-65d4-4b60-a141-a1e146578319}}, queued...
[1454445488.65][INF] sync KV found, uuid=d238e9ec-65d4-4b60-a141-a1e146578319, timestamp=1454445488.646000
[1454445488.65][INF] found KV pair in stream: {{timeout;15}}
[1454445488.65][INF] setting timeout to: 15 sec
[1454445488.65][INF] found KV pair in stream: {{host_test_name;echo}}
[1454445488.65][INF] host test setup() call...
[1454445488.65][TXD] {{echo;c9e15677-7713-480b-9dfa-4df7c6ab5fde}}
[1454445488.65][INF] CALLBACKs updated
[1454445488.65][INF] host test detected: echo
[1454445488.85][RXD] {{echo;c9e15677-7713-480b-9dfa-4df7c6ab5fde}}

def setup(self):
pass

def test(self):
Copy link

Choose a reason for hiding this comment

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

What's the function of test() ? Is it required to be implemented or optional? If required, should it raise NotImplemented error here?

"""! Setup your tests and callbacks """
raise NotImplementedError

def result(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we have result() method when an async test can notify completion by calling notify_complete. Two points to convey test results can cause buggy test implementation.

Copy link

Choose a reason for hiding this comment

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

+1 , I am still not about convinced result() neither

@PrzemekWirkus PrzemekWirkus changed the title [Devel] Async features [devel_transport] Async features Feb 25, 2016
PrzemekWirkus added a commit that referenced this pull request Mar 2, 2016
[devel_transport] Async features.

Roadmap to version 0.2.0
@PrzemekWirkus PrzemekWirkus merged commit 0715055 into master Mar 2, 2016
@PrzemekWirkus PrzemekWirkus deleted the devel_transport branch March 5, 2016 02:27
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.

3 participants