mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
Merge pull request #16034 from maribu/test-boards-supported
makefiles/tests: add unit test for info-boards-supported
This commit is contained in:
commit
bd7782c23f
2
dist/tools/boards_supported/check.sh
vendored
Executable file
2
dist/tools/boards_supported/check.sh
vendored
Executable file
@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
make --silent -C "$(dirname "$0")"/../../../makefiles/tests/boards_supported
|
1
dist/tools/ci/static_tests.sh
vendored
1
dist/tools/ci/static_tests.sh
vendored
@ -123,6 +123,7 @@ run ./dist/tools/flake8/check.sh
|
||||
run ./dist/tools/headerguards/check.sh
|
||||
run ./dist/tools/buildsystem_sanity_check/check.sh
|
||||
run ./dist/tools/feature_resolution/check.sh
|
||||
run ./dist/tools/boards_supported/check.sh
|
||||
run ./dist/tools/codespell/check.sh
|
||||
if [ -z "${GITHUB_RUN_ID}" ]; then
|
||||
run ./dist/tools/uncrustify/uncrustify.sh --check
|
||||
|
28
makefiles/tests/boards_supported/Makefile
Normal file
28
makefiles/tests/boards_supported/Makefile
Normal file
@ -0,0 +1,28 @@
|
||||
# In order to be able to include info-global.inc.mk, we need to provide some variables
|
||||
RIOTBASE ?= $(abspath $(CURDIR)/../../..)
|
||||
RIOTBOARD ?= $(RIOTBASE)/boards
|
||||
RIOTMAKE ?= $(RIOTBASE)/makefiles
|
||||
RIOTCPU ?= $(RIOTBASE)/cpu
|
||||
RIOTTOOLS ?= $(RIOTBASE)/dist/tools
|
||||
LAST_MAKEFILEDIR = $(abspath $(dir $(lastword $(MAKEFILE_LIST))))
|
||||
|
||||
# Folders to search: First the external boards, than the official
|
||||
BOARDSDIRS := $(EXTERNAL_BOARD_DIRS) $(RIOTBOARD)
|
||||
|
||||
# Take the first folder in $(BOARDSDIRS) that contains a folder named $(BOARD)
|
||||
BOARDDIR := $(word 1,$(foreach dir,$(BOARDSDIRS),$(wildcard $(dir)/$(BOARD)/.)))
|
||||
# Sanitize folder
|
||||
BOARDDIR := $(abspath $(BOARDDIR))
|
||||
|
||||
include $(RIOTMAKE)/utils/strings.mk
|
||||
include $(RIOTMAKE)/boards.inc.mk
|
||||
include $(RIOTMAKE)/info-global.inc.mk
|
||||
|
||||
ifneq (,$(BOARDS_WITH_MISSING_FEATURES))
|
||||
$(info BOARDS_FEATURES_MISSING=$(BOARDS_FEATURES_MISSING))
|
||||
$(error The CI will never build for the following boards: $(BOARDS_WITH_MISSING_FEATURES))
|
||||
endif
|
||||
|
||||
.PHONY: all
|
||||
all:
|
||||
@echo "Success"
|
15
makefiles/tests/boards_supported/README.md
Normal file
15
makefiles/tests/boards_supported/README.md
Normal file
@ -0,0 +1,15 @@
|
||||
Simple Unit Tests for `make info-boards-supported`
|
||||
==================================================
|
||||
|
||||
This folder contains a Makefile that runs a set of unit tests for the logic that figures out which
|
||||
boards are supported. In the past there have been some issues with this despite the feature
|
||||
resolution for a single board worked fine, so it is worth testing this functionality. This is
|
||||
especially true since this list is used by the CI to check which boards to build for.
|
||||
|
||||
Right now, only a single test case is added: It will run the logic behind
|
||||
`make info-boards-supported` without any modules used other than the default modules and subtracts
|
||||
the result from the list of all available boards. The resulting difference is the set of boards
|
||||
which will never be build by the CI - not even for `examples/hello-world`. If this result is empty,
|
||||
the test succeeds. Otherwise the list of never build boards will be printed and the test fails.
|
||||
|
||||
It is intended that some more advanced unit tests will be added later on.
|
Loading…
Reference in New Issue
Block a user