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

tests: combine similar network driver tests #5286

Closed
wants to merge 4 commits into from
Closed
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
41 changes: 0 additions & 41 deletions tests/driver_enc28j60/Makefile

This file was deleted.

46 changes: 0 additions & 46 deletions tests/driver_enc28j60/main.c

This file was deleted.

42 changes: 0 additions & 42 deletions tests/driver_encx24j600/Makefile

This file was deleted.

12 changes: 0 additions & 12 deletions tests/driver_kw2xrf/README.md

This file was deleted.

46 changes: 0 additions & 46 deletions tests/driver_kw2xrf/main.c

This file was deleted.

28 changes: 28 additions & 0 deletions tests/driver_netdev/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
APPLICATION = driver_netdev

include ../Makefile.tests_common

USEMODULE += shell
USEMODULE += shell_commands
USEMODULE += ps

# include specific driver makefiles in order to test compilation
# in order to make the test application work, comment all but one
include Makefile.enc28j60
include Makefile.encx24j600
include Makefile.kw2xrf
include Makefile.xbee

# test if multiple drivers are compiled in
ifneq (x,$(DRIVERS))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This always seem to be the case, when I parse the included makefiles correctly. Please explain.

CFLAGS += -DMULTIPLE_DRIVERS
BOARD_INSUFFICIENT_MEMORY += airfy-beacon nrf6310 pca10005 yunjia-nrf51822
endif

# make sure local parameter headers can be found
CFLAGS += -I$(CURDIR)

# lower pktbuf size
CFLAGS += -DGNRC_PKTBUF_SIZE=2048

include $(RIOTBASE)/Makefile.include
31 changes: 31 additions & 0 deletions tests/driver_netdev/Makefile.enc28j60
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
FEATURES_REQUIRED += periph_spi periph_gpio

BOARD_INSUFFICIENT_MEMORY += msb-430h nucleo-f334 stm32f0discovery weio z1

USEMODULE += enc28j60
USEMODULE += gnrc_netdev2
USEMODULE += gnrc_netdev_default
USEMODULE += auto_init_gnrc_netif
USEMODULE += gnrc_ipv6_router_default

# set board specific peripheral configurations
ifneq (,$(filter stm32f4discovery,$(BOARD)))
ENC28_SPI ?= SPI_1
ENC28_CS ?= GPIO_PIN\(PORT_B,12\)
ENC28_INT ?= GPIO_PIN\(PORT_B,11\)
ENC28_RST ?= GPIO_PIN\(PORT_B,10\)
endif

# fallback: set SPI bus and pins to default values
ENC28_SPI ?= SPI_0
ENC28_CS ?= GPIO_PIN\(0,0\)
ENC28_INT ?= GPIO_PIN\(0,1\)
ENC28_RST ?= GPIO_PIN\(0,2\)

# export SPI and pins
CFLAGS += -DENC28J60_PARAM_SPI=$(ENC28_SPI)
CFLAGS += -DENC28J60_PARAM_CS=$(ENC28_CS)
CFLAGS += -DENC28J60_PARAM_INT=$(ENC28_INT)
CFLAGS += -DENC28J60_PARAM_RESET=$(ENC28_RST)

DRIVERS += x
33 changes: 33 additions & 0 deletions tests/driver_netdev/Makefile.encx24j600
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
FEATURES_REQUIRED += periph_spi periph_gpio

BOARD_INSUFFICIENT_MEMORY += msb-430h stm32f0discovery weio z1

USEMODULE += encx24j600
USEMODULE += gnrc_netdev2
USEMODULE += gnrc_netdev_default
USEMODULE += auto_init_gnrc_netif
USEMODULE += gnrc_ipv6_router_default
USEMODULE += gnrc_icmpv6_echo
USEMODULE += shell
USEMODULE += shell_commands
USEMODULE += ps

# set board specific peripheral configurations
ifneq (,$(filter nucleo-f334,$(BOARD)))
# these settings are probably valid for PoEll-i on most nucleo boards, but
# tested only on nucleo-f334
ENCX24_SPI ?= SPI_0
ENCX24_CS ?= GPIO_PIN\(PORT_C,10\)
ENCX24_INT ?= GPIO_PIN\(PORT_D,2\)
endif

# fallback: set SPI bus and pins to default values
ENCX24_SPI ?= SPI_0
ENCX24_CS ?= GPIO_PIN\(0,0\)
ENCX24_INT ?= GPIO_PIN\(0,1\)
# export SPI and pins
CFLAGS += -DENCX24J600_SPI=$(ENCX24_SPI)
CFLAGS += -DENCX24J600_CS=$(ENCX24_CS)
CFLAGS += -DENCX24J600_INT=$(ENCX24_INT)

DRIVERS += x
Original file line number Diff line number Diff line change
@@ -1,30 +1,26 @@
APPLICATION = driver_kw2xrf
include ../Makefile.tests_common
FEATURES_REQUIRED += periph_spi periph_gpio

FEATURES_REQUIRED = periph_spi periph_gpio

BOARD_INSUFFICIENT_MEMORY := stm32f0discovery nucleo-f334 weio
BOARD_INSUFFICIENT_MEMORY += stm32f0discovery nucleo-f334 weio

USEMODULE += kw2xrf
USEMODULE += auto_init_gnrc_netif
USEMODULE += gnrc_netif
USEMODULE += gnrc_nomac
USEMODULE += gnrc_pktdump
USEMODULE += shell
USEMODULE += shell_commands
USEMODULE += ps

# define parameters for selected boards
ifneq (,$(filter pba-d-01-kw2x,$(BOARD)))
DRIVER := kw2xrf
USE_BOARD_PARAMETERS := true
# ensure the onboard params file is included before the generic one
CFLAGS += -I$(RIOTBASE)/boards/pba-d-01-kw2x/include
endif

# only set specific parameters if not using board configuration
ifneq (true,$(USE_BOARD_PARAMETERS))

# set default device parameters in case they are undefined
DRIVER ?= kw2xrf
KW2XRF_SHARED_SPI ?= 1
KW2XRF_SHARED_SPI ?= 0
KWRF_SPI ?= SPI_0
KWRF_SPI_SPEED ?= SPI_SPEED_5MHZ
KWRF_CS ?= GPIO_PIN\(0,0\)
Expand All @@ -36,18 +32,6 @@ ifneq (true,$(USE_BOARD_PARAMETERS))
CFLAGS += -DKWRF_SPI_SPEED=$(KWRF_SPI_SPEED)
CFLAGS += -DKWRF_CS=$(KWRF_CS)
CFLAGS += -DKWRF_INT=$(KWRF_INT)

# This adds . to include path so generic kw2xrf_params.h gets picked
# up. All boards actually having such a device on board should define
# USE_BOARD_PARAMETERS=true above to skip this step, as the board provides
# this header.
CFLAGS += -I$(CURDIR)

endif

# finally include the actual chosen driver
USEMODULE += $(DRIVER)

CFLAGS += -DDEVELHELP

include $(RIOTBASE)/Makefile.include
DRIVERS += x
16 changes: 16 additions & 0 deletions tests/driver_netdev/Makefile.xbee
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
USEMODULE += xbee

FEATURES_REQUIRED += periph_uart periph_gpio
BOARD_INSUFFICIENT_MEMORY += stm32f0discovery weio

USEMODULE += gnrc_netif
USEMODULE += auto_init_gnrc_netif
USEMODULE += gnrc_nomac

# set default UART to use in case none was defined
XBEE_UART ?= "UART_NUMOF-1"

# export UART to params file
CFLAGS += -DXBEE_UART=$(XBEE_UART)

DRIVERS += x
Loading