zephyr/cmake
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
..
app cmake: function to update Zephyr_DIR when loading old Zephyr packages 2022-03-07 16:35:54 +01:00
bintools ARC: MWDT: add missing options to generate symbol file 2022-07-13 12:00:39 -04:00
compiler cmake: compiler: arcmwdt: Add no_strict_aliasing flag 2022-08-11 17:45:58 +02:00
emu arch: common: dedicated SEMIHOST symbol 2022-04-21 13:04:52 +02:00
flash npcx: Set hex_file automatically w/ npcx hex image 2022-06-28 11:09:35 +02:00
ide
linker scripts: move gen_relocate_app.py to scripts/build 2022-07-12 10:03:45 +02:00
linker_script cmake: Fix typo in common-rom.cmake 2022-08-17 15:47:52 +00:00
makefile_exports
modules cmake: kconfig: introduce dedicated unit testing board 2022-08-18 14:29:14 +02:00
reports scripts: size_report: Add support for TF-M and BL2 image size reports 2022-03-09 14:03:52 -05:00
toolchain soc: xtensa: esp32_net: update kconfig 2022-08-16 18:06:02 +02:00
usage cmake: boards and shields cmake files repurposed 2022-02-22 10:02:39 -08:00
util
cfb.cmake scripts: move gen_cfb_font_header.py to scripts/build 2022-07-12 10:03:45 +02:00
extra_flags.cmake
gcc-m-cpu.cmake arch: arm64: define A55 core 2022-06-29 10:27:19 +02:00
gcc-m-fpu.cmake cmake: allow Cortex-R52 to configure VFP 2022-07-26 08:48:07 +02:00
gen_version_h.cmake cmake: Zephyr CMake package and CMake modules 2022-02-22 10:02:39 -08:00
hex.cmake
kobj.cmake scripts: move gen_kobject_list.py to scripts/build/gen_kobject_list.py 2022-07-12 10:03:45 +02:00
mcuboot.cmake
package_helper.cmake cmake: Update cmake_minimum_required to 3.20.0 2022-07-04 10:18:45 +02:00
pristine.cmake
target_toolchain_flags.cmake everywhere: fix typos 2022-03-14 20:22:24 -04:00