From cf379660e9bb145db60c814e38f1674d0cb5547f Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Wed, 15 Apr 2020 21:04:02 +0200 Subject: [PATCH] tests/external_board_dirs: Test app for EXTERNAL_BOARD_DIRS --- tests/external_board_dirs/Makefile | 11 +++++++ tests/external_board_dirs/README.md | 16 ++++++++++ .../external_board_dir_1/native1 | 1 + .../external_board_dir_2/native2 | 1 + tests/external_board_dirs/main.c | 32 +++++++++++++++++++ 5 files changed, 61 insertions(+) create mode 100644 tests/external_board_dirs/Makefile create mode 100644 tests/external_board_dirs/README.md create mode 120000 tests/external_board_dirs/external_board_dir_1/native1 create mode 120000 tests/external_board_dirs/external_board_dir_2/native2 create mode 100644 tests/external_board_dirs/main.c diff --git a/tests/external_board_dirs/Makefile b/tests/external_board_dirs/Makefile new file mode 100644 index 0000000000..ccece47119 --- /dev/null +++ b/tests/external_board_dirs/Makefile @@ -0,0 +1,11 @@ +include ../Makefile.tests_common + +# Require arch_native feature so this is not compiled for other boards in +# $(RIOTBOARD)/ +FEATURES_REQUIRED += arch_native + +# Set without '?=' to also verify the docker integration when set with = +EXTERNAL_BOARD_DIRS = $(CURDIR)/external_board_dir_1 +EXTERNAL_BOARD_DIRS += $(CURDIR)/external_board_dir_2 + +include $(RIOTBASE)/Makefile.include diff --git a/tests/external_board_dirs/README.md b/tests/external_board_dirs/README.md new file mode 100644 index 0000000000..285653aa37 --- /dev/null +++ b/tests/external_board_dirs/README.md @@ -0,0 +1,16 @@ +Test for `EXTERNAL_BOARD_DIRS` +============================== + +This test contains two directories containing external boards, namely +`external_board_dir_1` and `external_board_dir_2`. Each contains a symlink to +boards/native (so that this test does not need to maintain boards), the first +is named `native1` and the second `native2`. The variable `EXTERNAL_BOARD_DIRS` +is set to contain both directories. + +This test succeeds if: + +1. `make info-boards-supported` lists `native native1 native2` +2. Building works for all three boards, e.g. by + a) `make BOARD=native` + b) `make BOARD=native1` + c) `make BOARD=native2` diff --git a/tests/external_board_dirs/external_board_dir_1/native1 b/tests/external_board_dirs/external_board_dir_1/native1 new file mode 120000 index 0000000000..3b1d2bb906 --- /dev/null +++ b/tests/external_board_dirs/external_board_dir_1/native1 @@ -0,0 +1 @@ +../../../boards/native/ \ No newline at end of file diff --git a/tests/external_board_dirs/external_board_dir_2/native2 b/tests/external_board_dirs/external_board_dir_2/native2 new file mode 120000 index 0000000000..3b1d2bb906 --- /dev/null +++ b/tests/external_board_dirs/external_board_dir_2/native2 @@ -0,0 +1 @@ +../../../boards/native/ \ No newline at end of file diff --git a/tests/external_board_dirs/main.c b/tests/external_board_dirs/main.c new file mode 100644 index 0000000000..f51bf8c0a0 --- /dev/null +++ b/tests/external_board_dirs/main.c @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2014 Freie Universität Berlin + * + * 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 examples + * @{ + * + * @file + * @brief Hello World application + * + * @author Kaspar Schleiser + * @author Ludwig Knüpfer + * + * @} + */ + +#include + +int main(void) +{ + puts("Hello World!"); + + printf("You are running RIOT on a(n) %s board.\n", RIOT_BOARD); + printf("This board features a(n) %s MCU.\n", RIOT_MCU); + + return 0; +}