mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
Merge pull request #14658 from kaspar030/allow_shell_test_no_socat
tests/shell: allow not using socat, do so on z1
This commit is contained in:
commit
11cf4dfaff
@ -6,14 +6,20 @@ USEMODULE += shell
|
|||||||
USEMODULE += shell_commands
|
USEMODULE += shell_commands
|
||||||
USEMODULE += ps
|
USEMODULE += ps
|
||||||
|
|
||||||
|
# for z1, socat doesn't work (unknown reason)
|
||||||
|
ifeq (z1, $(BOARD))
|
||||||
|
RIOT_TERMINAL ?= pyterm
|
||||||
|
endif
|
||||||
|
|
||||||
# Use a terminal that does not introduce extra characters into the stream.
|
# Use a terminal that does not introduce extra characters into the stream.
|
||||||
RIOT_TERMINAL ?= socat
|
RIOT_TERMINAL ?= socat
|
||||||
|
|
||||||
DISABLE_MODULE += test_utils_interactive_sync
|
|
||||||
|
|
||||||
# chronos is missing a getchar implementation
|
# chronos is missing a getchar implementation
|
||||||
BOARD_BLACKLIST += chronos
|
BOARD_BLACKLIST += chronos
|
||||||
|
|
||||||
APP_SHELL_FMT ?= NONE
|
APP_SHELL_FMT ?= NONE
|
||||||
|
|
||||||
include $(RIOTBASE)/Makefile.include
|
include $(RIOTBASE)/Makefile.include
|
||||||
|
|
||||||
|
# the test script skips tests if socat is not used
|
||||||
|
$(call target-export-variables,$(RIOT_TERMINAL),RIOT_TERMINAL)
|
||||||
|
@ -27,6 +27,9 @@ EXPECTED_PS = (
|
|||||||
'\t \d | running Q | 7'
|
'\t \d | running Q | 7'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
RIOT_TERMINAL = os.environ.get('RIOT_TERMINAL')
|
||||||
|
CLEANTERMS = {"socat"}
|
||||||
|
|
||||||
# In native we are directly executing the binary (no terminal program). We must
|
# In native we are directly executing the binary (no terminal program). We must
|
||||||
# therefore use Ctrl-V (DLE or "data link escape") before Ctrl-C to send a
|
# therefore use Ctrl-V (DLE or "data link escape") before Ctrl-C to send a
|
||||||
# literal ETX instead of SIGINT.
|
# literal ETX instead of SIGINT.
|
||||||
@ -44,7 +47,6 @@ PROMPT = '> '
|
|||||||
CMDS = (
|
CMDS = (
|
||||||
# test start
|
# test start
|
||||||
('start_test', '[TEST_START]'),
|
('start_test', '[TEST_START]'),
|
||||||
(CONTROL_C, PROMPT),
|
|
||||||
('\n', PROMPT),
|
('\n', PROMPT),
|
||||||
|
|
||||||
# test simple word separation
|
# test simple word separation
|
||||||
@ -101,6 +103,10 @@ CMDS = (
|
|||||||
('end_test', '[TEST_END]'),
|
('end_test', '[TEST_END]'),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
CMDS_CLEANTERM = {
|
||||||
|
(CONTROL_C, PROMPT),
|
||||||
|
}
|
||||||
|
|
||||||
CMDS_REGEX = {'ps'}
|
CMDS_REGEX = {'ps'}
|
||||||
|
|
||||||
BOARD = os.environ['BOARD']
|
BOARD = os.environ['BOARD']
|
||||||
@ -181,14 +187,15 @@ def testfunc(child):
|
|||||||
if BOARD == 'native':
|
if BOARD == 'native':
|
||||||
child.crlf = '\n'
|
child.crlf = '\n'
|
||||||
|
|
||||||
check_startup(child)
|
|
||||||
|
|
||||||
bufsize = check_and_get_bufsize(child)
|
bufsize = check_and_get_bufsize(child)
|
||||||
longline = "_"*bufsize + "verylong"
|
longline = "_"*bufsize + "verylong"
|
||||||
|
|
||||||
check_line_exceeded(child, longline)
|
check_line_exceeded(child, longline)
|
||||||
|
|
||||||
check_line_canceling(child)
|
if RIOT_TERMINAL in CLEANTERMS:
|
||||||
|
check_line_canceling(child)
|
||||||
|
else:
|
||||||
|
print("skipping check_line_canceling()")
|
||||||
|
|
||||||
check_erase_long_line(child, longline)
|
check_erase_long_line(child, longline)
|
||||||
|
|
||||||
@ -196,6 +203,12 @@ def testfunc(child):
|
|||||||
for cmd, expected in CMDS:
|
for cmd, expected in CMDS:
|
||||||
check_cmd(child, cmd, expected)
|
check_cmd(child, cmd, expected)
|
||||||
|
|
||||||
|
if RIOT_TERMINAL in CLEANTERMS:
|
||||||
|
for cmd, expected in CMDS_CLEANTERM:
|
||||||
|
check_cmd(child, cmd, expected)
|
||||||
|
else:
|
||||||
|
print("skipping cleanterm tests")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
sys.exit(run(testfunc))
|
sys.exit(run(testfunc))
|
||||||
|
Loading…
Reference in New Issue
Block a user