diff --git a/tests/driver_at86rf215/Makefile b/tests/driver_at86rf215/Makefile index 9fd605967f..6a5eddcad6 100644 --- a/tests/driver_at86rf215/Makefile +++ b/tests/driver_at86rf215/Makefile @@ -1,28 +1,7 @@ BOARD ?= openmote-b -include ../Makefile.tests_common - -# Modules to include: -USEMODULE += shell -USEMODULE += shell_commands -USEMODULE += ps # the radio driver to test USEMODULE += at86rf215 GNRC_NETIF_NUMOF ?= 2 -# gnrc is a meta module including all required, basic gnrc networking modules -USEMODULE += gnrc - -# automatically initialize the network interface -USEMODULE += auto_init_gnrc_netif - -# shell command to send L2 packets with a simple string -USEMODULE += gnrc_txtsnd - -# the application dumps received packets to stdout -USEMODULE += gnrc_pktdump - -include $(RIOTBASE)/Makefile.include - -# Set a custom channel if needed -include $(RIOTMAKE)/default-radio-settings.inc.mk +include ../driver_netdev_common/Makefile diff --git a/tests/driver_at86rf215/main.c b/tests/driver_at86rf215/main.c deleted file mode 100644 index 66cc2bd986..0000000000 --- a/tests/driver_at86rf215/main.c +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2020 ML!PA Consulting GmbH - * - * This file is subject to the terms and conditions of the GNU Lesser - * General Public License v2.1. See the file LICENSE in the top level - * directory for more details. - */ - -/** - * @ingroup tests - * @{ - * - * @file - * @brief Test application for network device drivers - * - * @author Benjamin Valentin - * @} - */ - -#include "thread.h" -#include "shell.h" -#include "shell_commands.h" - -#include "net/gnrc/pktdump.h" -#include "net/gnrc.h" - -int main(void) -{ - /* enable pktdump output */ - gnrc_netreg_entry_t dump = GNRC_NETREG_ENTRY_INIT_PID(GNRC_NETREG_DEMUX_CTX_ALL, - gnrc_pktdump_pid); - gnrc_netreg_register(GNRC_NETTYPE_UNDEF, &dump); - - /* start the shell */ - char line_buf[SHELL_DEFAULT_BUFSIZE]; - shell_run(NULL, line_buf, SHELL_DEFAULT_BUFSIZE); - - return 0; -} diff --git a/tests/driver_at86rf215/main.c b/tests/driver_at86rf215/main.c new file mode 120000 index 0000000000..a3f88db08e --- /dev/null +++ b/tests/driver_at86rf215/main.c @@ -0,0 +1 @@ +../driver_netdev_common/main.c \ No newline at end of file diff --git a/tests/driver_netdev_common/Makefile b/tests/driver_netdev_common/Makefile new file mode 100644 index 0000000000..afc439312a --- /dev/null +++ b/tests/driver_netdev_common/Makefile @@ -0,0 +1,28 @@ +include ../Makefile.tests_common + +# Modules to include: +USEMODULE += shell +USEMODULE += shell_commands +USEMODULE += ps + +# allow to use a smaller packet buffer in low-PDU drivers +ifdef GNRC_PKTBUF_SIZE + CFLAGS += -DGNRC_PKTBUF_SIZE=$(GNRC_PKTBUF_SIZE) +endif + +# gnrc is a meta module including all required, basic gnrc networking modules +USEMODULE += gnrc + +# automatically initialize the network interface +USEMODULE += auto_init_gnrc_netif + +# shell command to send L2 packets with a simple string +USEMODULE += gnrc_txtsnd + +# the application dumps received packets to stdout +USEMODULE += gnrc_pktdump + +include $(RIOTBASE)/Makefile.include + +# Set a custom channel if needed +include $(RIOTMAKE)/default-radio-settings.inc.mk diff --git a/tests/driver_netdev_common/Makefile.ci b/tests/driver_netdev_common/Makefile.ci new file mode 100644 index 0000000000..f183d55718 --- /dev/null +++ b/tests/driver_netdev_common/Makefile.ci @@ -0,0 +1,17 @@ +BOARD_INSUFFICIENT_MEMORY := \ + arduino-duemilanove \ + arduino-leonardo \ + arduino-mega2560 \ + arduino-uno \ + atmega328p \ + i-nucleo-lrwan1 \ + nucleo-f030r8 \ + nucleo-f031k6 \ + nucleo-f042k6 \ + nucleo-l031k6 \ + nucleo-l053r8 \ + stm32f030f4-demo \ + stm32f0discovery \ + stm32l0538-disco \ + waspmote-pro \ + # diff --git a/tests/driver_netdev_common/main.c b/tests/driver_netdev_common/main.c new file mode 100644 index 0000000000..66cc2bd986 --- /dev/null +++ b/tests/driver_netdev_common/main.c @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2020 ML!PA Consulting GmbH + * + * This file is subject to the terms and conditions of the GNU Lesser + * General Public License v2.1. See the file LICENSE in the top level + * directory for more details. + */ + +/** + * @ingroup tests + * @{ + * + * @file + * @brief Test application for network device drivers + * + * @author Benjamin Valentin + * @} + */ + +#include "thread.h" +#include "shell.h" +#include "shell_commands.h" + +#include "net/gnrc/pktdump.h" +#include "net/gnrc.h" + +int main(void) +{ + /* enable pktdump output */ + gnrc_netreg_entry_t dump = GNRC_NETREG_ENTRY_INIT_PID(GNRC_NETREG_DEMUX_CTX_ALL, + gnrc_pktdump_pid); + gnrc_netreg_register(GNRC_NETTYPE_UNDEF, &dump); + + /* start the shell */ + char line_buf[SHELL_DEFAULT_BUFSIZE]; + shell_run(NULL, line_buf, SHELL_DEFAULT_BUFSIZE); + + return 0; +}