Skip to content

Commit

Permalink
examples, tests: Changes for the native64 board
Browse files Browse the repository at this point in the history
- Adapted build system and test checks for the native boards to include native64
- Added `native64` to the same tests as `native`
  • Loading branch information
fzi-haxel committed Feb 5, 2024
1 parent 0c2cfe9 commit 5ed0baf
Show file tree
Hide file tree
Showing 120 changed files with 206 additions and 162 deletions.
2 changes: 1 addition & 1 deletion examples/ccn-lite-relay/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ APPLICATION = ccn-lite-relay
# If no BOARD is found in the environment, use this default:
BOARD ?= native

BOARD_WHITELIST := iotlab-m3 msba2 mulle native nrf52dk nrf52840dk \
BOARD_WHITELIST := iotlab-m3 msba2 mulle native native64 nrf52dk nrf52840dk \
pba-d-01-kw2x samr21-xpro


Expand Down
4 changes: 2 additions & 2 deletions examples/gnrc_border_router/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ endif
# use ethos (ethernet over serial) or SLIP (serial-line IP) for network
# communication and stdio over UART, but not on native, as native has a tap
# interface towards the host.
ifeq (,$(filter native,$(BOARD)))
ifeq (,$(filter native native64,$(BOARD)))
ifeq (slip,$(UPLINK))
# SLIP baudrate and UART device can be configured from make command
SLIP_BAUDRATE ?= 115200
Expand Down Expand Up @@ -155,7 +155,7 @@ host-tools:
$(Q)env -u CC -u CFLAGS $(MAKE) -C $(RIOTTOOLS)

# define native specific targets to only run UHCP daemon when required
ifneq (,$(filter native,$(BOARD)))
ifneq (,$(filter native native64,$(BOARD)))
ifeq (uhcp,$(PREFIX_CONF))
.PHONY: uhcpd-daemon

Expand Down
2 changes: 1 addition & 1 deletion examples/gnrc_border_router/Makefile.board.dep
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Put board specific dependencies here
ifeq (,$(filter native,$(BOARD)))
ifeq (,$(filter native native64,$(BOARD)))
ifeq (slip,$(UPLINK))
USEMODULE += slipdev_stdio
else ifeq (ethos,$(UPLINK))
Expand Down
2 changes: 1 addition & 1 deletion examples/gnrc_border_router/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ To select ethos as the serial driver, be sure that the `Makefile`
has the following:

```make
ifeq (,$(filter native,$(BOARD)))
ifeq (,$(filter native native64,$(BOARD)))
USEMODULE += stdio_ethos
CFLAGS += '-DETHOS_UART=UART_DEV(0)' -DETHOS_BAUDRATE=115200
FEATURES_REQUIRED += periph_uart
Expand Down
2 changes: 1 addition & 1 deletion examples/javascript/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ RIOTBASE ?= $(CURDIR)/../..
# development process:
DEVELHELP ?= 1

ifneq ($(BOARD),native)
ifeq (,$(filter native native64,$(BOARD)))
# Set stack size to something (conservatively) enormous
CFLAGS += -DTHREAD_STACKSIZE_MAIN=9092
endif
Expand Down
2 changes: 1 addition & 1 deletion examples/lua_basic/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ DEVELHELP ?= 1
# Change this to 0 show compiler invocation lines by default:
QUIET ?= 1

ifneq ($(BOARD),native)
ifeq (,$(filter native native64,$(BOARD)))
# This stack size is large enough to run Lua print() functions of
# various lengths. Other functions untested.
CFLAGS += -DTHREAD_STACKSIZE_MAIN='(THREAD_STACKSIZE_DEFAULT+2048)'
Expand Down
4 changes: 2 additions & 2 deletions examples/nanocoap_server/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ ifneq (,$(filter $(BOARD),$(LOW_MEMORY_BOARDS)))
endif

# Enable fileserver for boards with plenty of memory
HIGH_MEMORY_BOARDS := native same54-xpro mcb2388
HIGH_MEMORY_BOARDS := native native64 same54-xpro mcb2388

ifneq (,$(filter $(BOARD),$(HIGH_MEMORY_BOARDS)))
USEMODULE += nanocoap_fileserver
USEMODULE += vfs_default

# always enable auto-format for native
ifeq ($(BOARD),native)
ifneq (,$(filter native native64,$(BOARD)))
USEMODULE += vfs_auto_format
endif
endif
Expand Down
2 changes: 1 addition & 1 deletion examples/paho-mqtt/Makefile.board.dep
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ ifneq (,$(filter arch_esp,$(FEATURES_USED)))
USEMODULE += esp_wifi
endif

ifeq ($(BOARD),native)
ifneq (,$(filter native native64,$(BOARD)))
USEMODULE += netdev_default
endif
2 changes: 1 addition & 1 deletion examples/suit_update/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ CFLAGS += -DSUIT_MANIFEST_RESOURCE=\"$(SUIT_COAP_ROOT)/$(SUIT_NOTIFY_MANIFEST)\"
# Enable test_utils_interactive_sync, only used when running automatic test
DEFAULT_MODULE += test_utils_interactive_sync

ifeq ($(BOARD),native)
ifneq (,$(filter native native64,$(BOARD)))
USE_ETHOS ?= 0
IFACE ?= tapbr0
# Configure two RAM regions with 2K each
Expand Down
2 changes: 1 addition & 1 deletion examples/suit_update/Makefile.board.dep
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ifeq ($(BOARD),native)
ifneq (,$(filter native native64,$(BOARD)))
USEMODULE += suit_storage_ram
USEMODULE += netdev_default
# Use VFS storage for native
Expand Down
4 changes: 2 additions & 2 deletions examples/suit_update/Makefile.suit.custom
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ EPOCH = $(call memoized,EPOCH,$(shell date +%s))
APP_VER ?= $(EPOCH)

# Default addressing if following README.native.md
ifeq ($(BOARD),native)
ifneq (,$(filter native native64,$(BOARD)))
SUIT_CLIENT ?= [2001:db8::2]
SUIT_COAP_SERVER ?= [2001:db8::1]
$(call target-export-variables,test-with-config,SUIT_COAP_SERVER)
endif

ifeq ($(BOARD),native)
ifneq (,$(filter native native64,$(BOARD)))
# Set settings for publishing fake fw payloads to native
SUIT_NATIVE_PAYLOAD ?= "AABBCCDD"
SUIT_NATIVE_PAYLOAD_BIN ?= $(BINDIR_APP)/fw.$(APP_VER).bin
Expand Down
4 changes: 2 additions & 2 deletions examples/suit_update/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

#include "suit/storage.h"
#include "suit/storage/ram.h"
#ifdef BOARD_NATIVE
#ifdef CPU_NATIVE
#include "suit/storage/vfs.h"
#include "xfa.h"
#include "vfs_default.h"
Expand All @@ -57,7 +57,7 @@ static msg_t _main_msg_queue[MAIN_QUEUE_SIZE];
/* add handled storages */
#if IS_USED(MODULE_SUIT_STORAGE_VFS)
XFA_USE(char*, suit_storage_files_reg);
#ifdef BOARD_NATIVE
#ifdef CPU_NATIVE
XFA(suit_storage_files_reg, 0) char* _slot0 = VFS_DEFAULT_DATA "/SLOT0.txt";
XFA(suit_storage_files_reg, 1) char* _slot1 = VFS_DEFAULT_DATA "/SLOT1.txt";
#endif
Expand Down
4 changes: 2 additions & 2 deletions examples/suit_update/tests-with-config/01-run.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def get_reachable_addr(child):
# Give some time for the network interface to be configured
time.sleep(1)
# Get address
if BOARD == "native":
if BOARD in ["native", "native64"]:
iface_addr = get_iface_addr(IFACE)
network = IPv6Network(iface_addr, strict=False)
client_addr = iface_addr
Expand Down Expand Up @@ -212,7 +212,7 @@ def _test_successful_update(child, client, app_ver):
child.expect_exact("Install correct payload")

# Wait for reboot on non-native BOARDs
if BOARD != "native":
if BOARD not in ["native", "native64"]:
child.expect_exact(REBOOTING_MSG)
# Verify client is reachable and get address
client = get_reachable_addr(child)
Expand Down
4 changes: 2 additions & 2 deletions examples/suit_update/tests-with-config/check-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ip link show dev "${IFACE}" > /dev/null
RESULT=$?

if [ $RESULT -eq 0 ]; then
if [ "${BOARD}" = "native" ]; then
if [ "${BOARD}" = "native" ] || [ "${BOARD}" = "native64" ]; then
IFACE_IPV6_ADDR=$(ip -6 addr show dev "${IFACE}"| grep inet6 | \
awk -F '[ \t]+|/' '{print $3}' | grep -v ^::1 | \
grep -v ^fe80)
Expand All @@ -23,7 +23,7 @@ if [ $RESULT -eq 0 ]; then
fi
fi

if [ "${BOARD}" = "native" ]; then
if [ "${BOARD}" = "native" ] || [ "${BOARD}" = "native64" ]; then
echo "You may be able to create \"${IFACE}\" by using e.g." \
"\`${RIOTTOOLS#${RIOTBASE}/}/tapsetup/tapsetup\`."
echo "You can add a routable IPV6 address by using e.g." \
Expand Down
2 changes: 1 addition & 1 deletion examples/wasm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ RIOTBASE ?= $(CURDIR)/../..

USEPKG += wamr

ifneq ($(BOARD),native)
ifeq (,$(filter native native64,$(BOARD)))
CFLAGS += -DTHREAD_STACKSIZE_MAIN='(6 * 1024)'
endif

Expand Down
1 change: 1 addition & 0 deletions tests/Makefile.boards.netif
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ BOARD_PROVIDES_NETIF := \
msba2 \
mulle \
native \
native64 \
nrf51dk \
nrf51dongle \
nrf52840-mdk \
Expand Down
2 changes: 1 addition & 1 deletion tests/bench/runtime_coreapis/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ USEMODULE += benchmark
ifeq (llvm,$(TOOLCHAIN))
# the floating point exception bug is more likely to trigger when build
# with LLVM, so we just disable LLVM on native as a work around
TEST_ON_CI_BLACKLIST += native
TEST_ON_CI_BLACKLIST += native native64
endif

include $(RIOTBASE)/Makefile.include
1 change: 1 addition & 0 deletions tests/bench/timers/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ include ../Makefile.bench_common
# CFLAGS configuration to build properly
SINGLE_TIMER_BOARDS = \
native \
native64 \
nucleo-f031k6 \
nucleo-f042k6 \
#
Expand Down
2 changes: 1 addition & 1 deletion tests/build_system/external_board_native/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ BOARD ?= native
FEATURES_REQUIRED += arch_native

# Set without '?=' to also verify the docker integration when set with =
BOARDSDIR = $(CURDIR)/external_boards
EXTERNAL_BOARD_DIRS = $(CURDIR)/external_boards

include $(RIOTBASE)/Makefile.include
4 changes: 3 additions & 1 deletion tests/build_system/external_board_native/tests/01-run.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@
# directory for more details.

import sys
import os
from testrunner import run


def testfunc(child):
board = os.environ['BOARD']
child.expect_exact("Hello World!")
child.expect_exact("You are running RIOT on a(n) native board.")
child.expect_exact(f"You are running RIOT on a(n) {board} board.")
child.expect_exact("THIS_BOARD_IS external_native")
child.expect_exact("This board is 'An external extended native")
print("Test successful!!")
Expand Down
2 changes: 1 addition & 1 deletion tests/build_system/utils/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
BOARD_WHITELIST = native
BOARD_WHITELIST = native native64

include ../Makefile.build_system_common
include $(RIOTBASE)/Makefile.include
Expand Down
2 changes: 1 addition & 1 deletion tests/core/msg_queue_print/tests/01-run.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def testfunc(child):
child.expect("No messages or no message queue")
child.expect(r"Message queue of thread \d+\r\n")
child.expect_exact('size: 8 (avail: 8)')
if os.environ.get('BOARD') == 'native':
if os.environ.get('BOARD') in ['native', 'native64']:
child.expect_exact('type: 0x0000, content: 0 ((nil))')
else:
child.expect(r'type: 0x0000, content: 0 \((0x)?0+\)')
Expand Down
2 changes: 1 addition & 1 deletion tests/core/mutex_unlock_and_sleep/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ static volatile int indicator;
static kernel_pid_t main_pid;
static char stack[THREAD_STACKSIZE_DEFAULT];

#ifdef BOARD_NATIVE
#ifdef CPU_NATIVE
static const unsigned KITERATIONS = 100;
#else
static const unsigned KITERATIONS = 10;
Expand Down
2 changes: 1 addition & 1 deletion tests/core/thread_float/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ USEMODULE += ztimer_usec
# native has known issues: the context switch via glibc's setcontext()
# apparently doesn't properly save and restore the FPU state. This results in
# occasionally wrong results (often nan) being printed for the same calculation
TEST_ON_CI_BLACKLIST += native
TEST_ON_CI_BLACKLIST += native native64

#DISABLE_MODULE += cortexm_fpu

Expand Down
2 changes: 1 addition & 1 deletion tests/cpu/native_backtrace/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ include ../Makefile.cpu_common

USEMODULE += backtrace

BOARD_WHITELIST := native
BOARD_WHITELIST := native native64

# Tests if native returns a backtrace of size three.
# The following function should be included in the backtrace:
Expand Down
2 changes: 1 addition & 1 deletion tests/drivers/candev/Makefile.board.dep
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ifneq (,$(filter native,$(BOARD)))
ifneq (,$(filter native native64,$(BOARD)))
CAN_DRIVER ?= PERIPH_CAN
endif

Expand Down
2 changes: 1 addition & 1 deletion tests/drivers/grove_ledbar/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ include ../Makefile.drivers_common
USEMODULE += grove_ledbar

# disable native GPIOs for automatic test
ifeq (native,$(BOARD))
ifneq (,$(filter native native64,$(BOARD)))
USEMODULE += periph_gpio_mock
# the same for Kconfig
ifeq (1,$(TEST_KCONFIG))
Expand Down
2 changes: 1 addition & 1 deletion tests/drivers/hd44780/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ include ../Makefile.drivers_common
USEMODULE += hd44780

# disable native GPIOs for automatic test
ifeq (native,$(BOARD))
ifneq (,$(filter native native64,$(BOARD)))
USEMODULE += periph_gpio_mock
# the same for Kconfig
ifeq (1,$(TEST_KCONFIG))
Expand Down
1 change: 1 addition & 0 deletions tests/drivers/mrf24j40/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ BOARD_WHITELIST += adafruit-clue \
cc2538dk \
feather-nrf52840 \
native \
native64 \
nrf52840dk \
nrf52840dongle \
nrf52840-mdk \
Expand Down
2 changes: 1 addition & 1 deletion tests/drivers/my9221/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ include ../Makefile.drivers_common
USEMODULE += my9221

# disable native GPIOs for automatic test
ifeq (native,$(BOARD))
ifneq (,$(filter native native64,$(BOARD)))
USEMODULE += periph_gpio_mock
# the same for Kconfig
ifeq (1,$(TEST_KCONFIG))
Expand Down
2 changes: 1 addition & 1 deletion tests/minimal/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ DISABLE_MODULE += test_utils_print_stack_usage
USEMODULE += stdio_null

# adjust stack sizes to very small values
ifneq (native,$(BOARD))
ifeq (,$(filter native native64,$(BOARD)))
CFLAGS += -DTHREAD_STACKSIZE_MAIN=256 -DTHREAD_STACKSIZE_IDLE=128
endif

Expand Down
2 changes: 1 addition & 1 deletion tests/net/emcute/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ RIOTBASE ?= $(CURDIR)/../..
export TAP ?= tap0

# use Ethernet as link-layer protocol
ifeq (native,$(BOARD))
ifneq (,$(filter native native64,$(BOARD)))
PORT ?= $(TAP)
else
ETHOS_BAUDRATE ?= 115200
Expand Down
2 changes: 1 addition & 1 deletion tests/net/emcute/Makefile.board.dep
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Put board specific dependencies here
ifeq (native,$(BOARD))
ifneq (,$(filter native native64,$(BOARD)))
USEMODULE += netdev_tap
else
USEMODULE += stdio_ethos
Expand Down
2 changes: 1 addition & 1 deletion tests/net/gcoap_dns/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ CFLAGS += -DHAS_SOCK_DNS_MOCK=1

include $(RIOTBASE)/Makefile.include

ifeq (native,$(BOARD))
ifneq (,$(filter native native64,$(BOARD)))
test: PORT=
$(call target-export-variables,test,PORT)
endif
4 changes: 2 additions & 2 deletions tests/net/gcoap_fileserver/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ USEMODULE += shell_cmd_md5sum
TEST_ON_CI_BLACKLIST += all

# automated test only works on native
# TEST_ON_CI_WHITELIST += native
# TEST_ON_CI_WHITELIST += native native64

# use small blocksize for test to increase chance for errors
CFLAGS += -DCONFIG_NANOCOAP_BLOCKSIZE_DEFAULT=COAP_BLOCKSIZE_16
CFLAGS += -DCONFIG_COAP_ACK_TIMEOUT_MS=100UL
CFLAGS += -DCONFIG_COAP_MAX_RETRANSMIT=10

ifeq (native, $(BOARD))
ifneq (,$(filter native native64,$(BOARD)))
USEMODULE += socket_zep
USEMODULE += socket_zep_hello
USEMODULE += netdev
Expand Down
Loading

0 comments on commit 5ed0baf

Please sign in to comment.