-
Notifications
You must be signed in to change notification settings - Fork 2k
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
tools/serial.inc.mk: Support miniterm.py. #11003
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's indeed useful to provide support for miniterm even if it's not the default.
I haven't tried this PR but I think local echo should also be enabled by default. There are also a couple minor issues.
tests/shell/Makefile
Outdated
@@ -1,4 +1,5 @@ | |||
DEVELHELP=0 | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unrelated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, that slipped through when I splitted the change.
tests/shell/Makefile
Outdated
@@ -12,4 +13,8 @@ BOARD_BLACKLIST += chronos | |||
|
|||
TEST_ON_CI_WHITELIST += all | |||
|
|||
ifneq ($(BOARD), native) | |||
RIOT_TERMINAL=miniterm.py |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like there's tab here. The indent should be 2 spaces.
makefiles/tools/serial.inc.mk
Outdated
@@ -19,4 +19,7 @@ ifeq ($(RIOT_TERMINAL),pyterm) | |||
else ifeq ($(RIOT_TERMINAL),picocom) | |||
export TERMPROG ?= picocom | |||
export TERMFLAGS ?= --nolock --imap lfcrlf --echo --baud "$(BAUD)" "$(PORT)" | |||
else ifeq ($(RIOT_TERMINAL),miniterm.py) | |||
export TERMPROG ?= miniterm.py | |||
export TERMFLAGS ?= --eol CRLF "$(PORT)" "$(BAUD)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe also enable --echo
? It's the kind of useful things when using the shell.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With local echo you end up having double echo, as the shell echoes too, and miniterm does not do line buffering, eg.:
> hheellpp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having local echo messes with the tests also as the sent string is matched by pexpect.
5d1197c
to
7478f60
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested tests/shell
with miniterm and confirm that it also works.
I have other comments.
makefiles/tools/serial.inc.mk
Outdated
@@ -19,4 +19,9 @@ ifeq ($(RIOT_TERMINAL),pyterm) | |||
else ifeq ($(RIOT_TERMINAL),picocom) | |||
export TERMPROG ?= picocom | |||
export TERMFLAGS ?= --nolock --imap lfcrlf --echo --baud "$(BAUD)" "$(PORT)" | |||
else ifeq ($(RIOT_TERMINAL),miniterm.py) | |||
export TERMPROG ?= miniterm.py |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
export TERMPROG ?= miniterm.py | |
export TERMPROG ?= $(RIOT_TERMINAL) |
Not blocking for this
tests/shell/Makefile
Outdated
# In order to properly test and debug the shell it is better to use a terminal | ||
# program that does not modify the input and output streams and has no buffering. | ||
ifneq ($(BOARD), native) | ||
RIOT_TERMINAL?=miniterm.py |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tab is still there. I would put space around ?=
like it's done in other places.
@@ -12,4 +12,10 @@ BOARD_BLACKLIST += chronos | |||
|
|||
TEST_ON_CI_WHITELIST += all | |||
|
|||
# In order to properly test and debug the shell it is better to use a terminal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why just set this in tests/shell
only ? I would prefer to have this set globally in Makefile.tests_common
.
7478f60
to
0c27453
Compare
@aabadie I rebased this on top of your indentation fix. |
miniterm.py is a simple terminal program that is included with pyserial. This means that it is available wherever pyterm can work. It allows raw access, does line translation and passes through special characters. For test scripts, a terminal that does not modify the input and output streams, configured without local echo, is preferred as it ensures the test setup is introducing as few noise as possible.
When testing #10952 I found that having local echo may even be hurting for testing as it introduces more text in the tested text. |
I would prefer to move changing the test configuration in a different PR as it relates to the main tracking issue and not to adding the support. Adding support should be done alone and it does not hurt anything. |
#11034 makes this PR irrelevant. Socat is a better tool. I'm closing this. |
Contribution description
miniterm.py is a simple terminal program that is included with pyserial. This means that it is available wherever pyterm can work. It allows raw access, does line translation and passes through special characters.
For test scripts, a terminal that does not modify the input and output streams, configured without local echo, is preferred as it ensures the test setup is introducing as few noise as possible.
Testing procedure
With this change,
tests/shell
uses miniterm.py. Just run the tests. Use a real board, native has no real TTY.Issues/PRs references
This PR is part of #10994 and it's purpose is to ease shell automation.
Split from #10788 .