zephyr/cmake/modules
Torsten Rasmussen 7a65bdbd64 cmake: kconfig: introduce dedicated unit testing board
This commit introduces a dedicated unit testing board.

Today, a dedicated Zephyr unit testing scheme exists but is different
from how a Zephyr build generally works.

For example Kconfig is not possible, resulting on various different
hacks to pass Kconfig settings from test cases / testcase.yaml through
CMake to the code.
Some directly as compile definitions, some as header files with forced
inclusion on sources, some with wrapper flags which again results in
different define being enabled. There is even cases where a second
forced header inclusion undefines previous defines.

Unit test often does a manual check for the right boards, like this:
> if (NOT BOARD STREQUAL unit_testing)
>    message(FATAL_ERROR "This project can only be used with...")
> endif()

Introducing a dedicated unit_testing board under `tests/root` allows
us to use Kconfig in unit test samples, and thus proper `prj.conf` and
extra Kconfig fragments.
Generation of autoconf.h so the overall architecture follows regular
Zephyr builds.

Proper and uniform error messages when invalid board is selected.

The unit_testing board and arch is located under: `subsys/testsuite` so
that it is only available when find_package(Zephyr COMPONENTS unittest)
is used, and not available for regular Zephyr builds.

Kconfig generates autoconf.h which is applied as compile flag to
test binary which means that kconfig defines placed in ztest.h can now
be removed.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2022-08-18 14:29:14 +02:00
..
arch.cmake cmake: kconfig: introduce dedicated unit testing board 2022-08-18 14:29:14 +02:00
boards.cmake cmake: kconfig: introduce dedicated unit testing board 2022-08-18 14:29:14 +02:00
ccache.cmake cmake: Zephyr CMake package and CMake modules 2022-02-22 10:02:39 -08:00
configuration_files.cmake everywhere: fix typos 2022-03-18 13:24:08 -04:00
doc.cmake cmake: doc: created a doc.cmake CMake module in Zephyr CMake modules dir 2022-02-22 10:02:39 -08:00
dts.cmake Restore "cmake: remove device_extern.h logic" 2022-08-12 07:45:01 +01:00
extensions.cmake scripts: move file2hex.py to scripts/build/file2hex.py 2022-07-12 10:03:45 +02:00
generic_toolchain.cmake cmake: Zephyr CMake package and CMake modules 2022-02-22 10:02:39 -08:00
host-tools.cmake cmake: Zephyr CMake package and CMake modules 2022-02-22 10:02:39 -08:00
kconfig.cmake cmake: define and create KCONFIG_BINARY_DIR if it doesn't exists 2022-08-18 14:29:14 +02:00
kernel.cmake build: generate symbols file 2022-07-11 11:56:39 +02:00
python.cmake cmake: Zephyr CMake package and CMake modules 2022-02-22 10:02:39 -08:00
root.cmake cmake: kconfig: introduce dedicated unit testing board 2022-08-18 14:29:14 +02:00
shields.cmake devicetree: drop support for dts_fixup.h files 2022-08-11 12:17:02 +02:00
soc.cmake cmake: Zephyr CMake package and CMake modules 2022-02-22 10:02:39 -08:00
target_toolchain.cmake cmake: Zephyr CMake package and CMake modules 2022-02-22 10:02:39 -08:00
unittest.cmake cmake: kconfig: introduce dedicated unit testing board 2022-08-18 14:29:14 +02:00
user_cache.cmake scripts: move dir_is_writeable.py to scripts/build 2022-07-12 10:03:45 +02:00
verify-toolchain.cmake cmake: Use cmake var not env for sdk 2022-08-05 14:03:15 +02:00
version.cmake cmake: Zephyr CMake package and CMake modules 2022-02-22 10:02:39 -08:00
west.cmake cmake: Zephyr CMake package and CMake modules 2022-02-22 10:02:39 -08:00
zephyr_default.cmake cmake: test CMake and issue error if using 3.22.1 / 3.22.2 from PyPI 2022-02-25 10:16:25 -08:00
zephyr_module.cmake scripts: enforce module name uniqueness 2022-03-10 09:47:58 -05:00