tests/sys_arduino: fix test synchronization issues#12962
Merged
aabadie merged 1 commit intoRIOT-OS:masterfrom Jan 15, 2020
Merged
tests/sys_arduino: fix test synchronization issues#12962aabadie merged 1 commit intoRIOT-OS:masterfrom
aabadie merged 1 commit intoRIOT-OS:masterfrom
Conversation
The test currently doesn't wait for synchronization of the serial terminal the second time it is setup with `Serial.begin`. This results in the test commands being sent before the terminal is ready which causes the test to fail. To fix this add an expect_exact on "Hello arduino". (NOTE: this is different form `interactive_sync` which synchronizes the start of the test, here we want `uart` to properly re-init)
cedea1a to
b581223
Compare
Contributor
Author
|
With #12973 this only needs to match |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Contribution description
The test currently doesn't wait for synchronization of the serial
terminal the second time it is setup with
Serial.beginthis resultsin the tests command being sent before the terminal is ready which
causes the test to fail. To fix this add an expect_exact on "Hello
arduino". (NOTE: this is different form
interactive_syncwhichsynchronizes the start of the test, but here we must wait for the
uart to be started again.)
On slow platforms there might still be data in the Transmit shift register
when the uart is re-initialized, which causes the first character of the
print to be rubish, print an empty space to workaround this. A delay
also works but would have to be adapted to the baudrate, and would
lengthen startup code, it would also introduce timer depedencies in
unwanted places.
Testing procedure
arduino-uno"Hello Arduino" will be cleanly printed.arduino-unoand other platforms, it will also pass rebased on dist/pythonlibs/testrunner: reset before term #12862BOARD=arduino-uno make -C tests/sys_arduino flash test
Issues/PRs references