Skip to content
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

boards/native: only use pyterm wrapper with term target #20264

Merged
merged 4 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 31 additions & 19 deletions boards/native/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,39 @@ else
DEBUGGER ?= gdb
endif

# only use pyterm wrapper if term target is requested
ifeq (,$(filter term,$(MAKECMDGOALS)))
RIOT_TERMINAL ?= native
else
RIOT_TERMINAL ?= pyterm
endif

RESET ?= $(RIOTBOARD)/native/dist/reset.sh
FLASHER ?=
FLASHFILE ?= $(ELFFILE)

ifeq (native,$(RIOT_TERMINAL))
ifeq (pyterm,$(RIOT_TERMINAL))
TERMFLAGS += -ps $(FLASHFILE)
PROCARGS := --process-args
else
TERMPROG ?= $(FLASHFILE)
endif

ZEP_IP ?= [::1]
ZEP_PORT_BASE ?= 17754
ifeq (1,$(USE_ZEP))
ifeq (pyterm,$(RIOT_TERMINAL))
TERMFLAGS += --process-args '-z $(ZEP_IP):$(ZEP_PORT_BASE)'
else
TERMFLAGS += -ps $(FLASHFILE)
ifeq (1,$(USE_ZEP))
ZEP_IP ?= [::1]
ZEP_PORT_BASE ?= 17754
TERMFLAGS += --process-args '-z $(ZEP_IP):$(ZEP_PORT_BASE)'
endif
ifneq (,$(ZEP_MAC))
TERMFLAGS += --process-args '\-\-eui64=$(ZEP_MAC)'
endif
TERMFLAGS += -z $(ZEP_IP):$(ZEP_PORT_BASE)
endif
endif
ifneq (,$(ZEP_MAC))
ifeq (pyterm,$(RIOT_TERMINAL))
TERMFLAGS += --process-args '\-\-eui64=$(ZEP_MAC)'
else
TERMFLAGS += --eui64=$(ZEP_MAC)
endif
endif

export VALGRIND ?= valgrind
Expand Down Expand Up @@ -101,23 +118,18 @@ LINKFLAGS += -ffunction-sections

# set the tap interface for term/valgrind
PORT ?= tap0

ifeq (native,$(RIOT_TERMINAL))
TERMFLAGS += $(PORT)
else
TERMFLAGS += --process-args $(PORT)
endif
TERMFLAGS += $(PROCARGS) $(PORT)

# Configure default eeprom file
EEPROM_FILE ?= $(BINDIR)/native.eeprom

# set the eeprom file flags only when the periph_eeprom feature is used.
ifneq (,$(filter periph_eeprom,$(FEATURES_USED)))
EEPROM_FILE_FLAGS = --eeprom $(EEPROM_FILE)
ifeq (native,$(RIOT_TERMINAL))
TERMFLAGS += $(EEPROM_FILE_FLAGS)
else
ifeq (pyterm,$(RIOT_TERMINAL))
TERMFLAGS += --process-args '$(EEPROM_FILE_FLAGS)'
else
TERMFLAGS += $(EEPROM_FILE_FLAGS)
endif
endif

Expand Down
5 changes: 2 additions & 3 deletions dist/pythonlibs/riotctrl_ctrl/native.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,5 @@ def _set_debug_adapter_id(self, child):
def start_term(self, *args, **kwargs):
super().start_term(*args, **kwargs)
for child in psutil.Process(pid=self._term_pid()).children():
for grandchild in child.children():
if self._set_debug_adapter_id(grandchild):
break
if self._set_debug_adapter_id(child):
break
1 change: 0 additions & 1 deletion dist/pythonlibs/riotctrl_ctrl/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
psutil
pyserial
riotctrl
4 changes: 0 additions & 4 deletions makefiles/tests/tests.inc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ TEST_DEPS += $(TERMDEPS)
TEST_EXECUTOR ?=
TEST_EXECUTOR_FLAGS ?=

ifeq (native, $(BOARD))
TEST_EXECUTOR := RIOT_TERMINAL=native $(TEST_EXECUTOR)
endif

test: $(TEST_DEPS)
$(Q) for t in $(TESTS); do \
$(TEST_EXECUTOR) $(TEST_EXECUTOR_FLAGS) $$t || exit 1; \
Expand Down
Loading