tools/serial.inc.mk: Support miniterm.py.#11003
tools/serial.inc.mk: Support miniterm.py.#11003jcarrano wants to merge 2 commits intoRIOT-OS:masterfrom
Conversation
aabadie
left a comment
There was a problem hiding this comment.
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.
Oops, that slipped through when I splitted the change.
tests/shell/Makefile
Outdated
| TEST_ON_CI_WHITELIST += all | ||
|
|
||
| ifneq ($(BOARD), native) | ||
| RIOT_TERMINAL=miniterm.py |
There was a problem hiding this comment.
Looks like there's tab here. The indent should be 2 spaces.
makefiles/tools/serial.inc.mk
Outdated
| 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.
Maybe also enable --echo ? It's the kind of useful things when using the shell.
There was a problem hiding this comment.
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.
Having local echo messes with the tests also as the sent string is matched by pexpect.
5d1197c to
7478f60
Compare
aabadie
left a comment
There was a problem hiding this comment.
I tested tests/shell with miniterm and confirm that it also works.
I have other comments.
makefiles/tools/serial.inc.mk
Outdated
| 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.
| 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.
The tab is still there. I would put space around ?= like it's done in other places.
|
|
||
| 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.
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/shelluses 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 .