tests/test_tools: add a test for the testing tools environment#12072
Merged
MrKevinWeiss merged 1 commit intoRIOT-OS:masterfrom Aug 26, 2019
Merged
tests/test_tools: add a test for the testing tools environment#12072MrKevinWeiss merged 1 commit intoRIOT-OS:masterfrom
MrKevinWeiss merged 1 commit intoRIOT-OS:masterfrom
Conversation
Check the interaction with a board through make term. It is using a shell without echo or prompt for reference. It currently checks that there is no local echo.
Contributor
|
I did some testing and here are my results.
|
Contributor
|
Fundamentals are sound. We should be testing our tools. |
Contributor
|
It seems like all the |
Contributor
Author
|
@MrKevinWeiss What you see is the text sent by pexpect, not a local echo. You can check what it is testing with the following diff: With `pyterm`, when `pexpect` has local echo capturing we get the double outputdiff --git a/dist/pythonlibs/testrunner/spawn.py b/dist/pythonlibs/testrunner/spawn.py
index 84164d1a1..a7c03e22e 100644
--- a/dist/pythonlibs/testrunner/spawn.py
+++ b/dist/pythonlibs/testrunner/spawn.py
@@ -37,7 +37,7 @@ def find_exc_origin(exc_info):
def setup_child(timeout=10, spawnclass=pexpect.spawnu, env=None, logfile=None):
child = spawnclass("make term", env=env, timeout=timeout,
- codec_errors='replace', echo=False)
+ codec_errors='replace', echo=True)
# on many platforms, the termprog needs a short while to be ready...
time.sleep(MAKE_TERM_STARTED_DELAY)When picocom has local `--echo` enabled, we get the matchdiff --git a/makefiles/tools/serial.inc.mk b/makefiles/tools/serial.inc.mk
index 8abcf7fe1..45f747343 100644
--- a/makefiles/tools/serial.inc.mk
+++ b/makefiles/tools/serial.inc.mk
@@ -22,5 +22,5 @@ else ifeq ($(RIOT_TERMINAL),socat)
TERMFLAGS ?= $(SOCAT_OUTPUT) open:$(PORT),b$(BAUD),echo=0,raw
else ifeq ($(RIOT_TERMINAL),picocom)
TERMPROG ?= picocom
- TERMFLAGS ?= --nolock --imap lfcrlf --baud "$(BAUD)" "$(PORT)"
+ TERMFLAGS ?= --echo --nolock --imap lfcrlf --baud "$(BAUD)" "$(PORT)"
endifI am not sure why I do not get 3 match when using both patch with |
Contributor
Author
|
Thank you for the review. |
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
Check the interaction with a board through make term.
It is using a shell without echo or prompt for reference.
It currently checks that there is no local echo.
Now that the issue in
testrunnerand theRIOT_TERMINALis fixed, it is more a sanity check/regression test to verify your environment or a board configuration does not mess up with what is required for testing.Testing procedure
Run
BOARD=your_board make -C tests/test_tools/ flash testwith differentRIOT_TERMINAL, currently supported (not on all boards)pyterm,socat,picocom.The test should succeed in all cases.
RIOT_TERMINAL=pyterm samr21-xproRIOT_TERMINAL=picocom samr21-xproRIOT_TERMINAL=socat samr21-xpronativeOn IoT-LAB it works tooIssues/PRs references
Split out of