Fix the deprecated calls to loading ZephyrUnittest by replacing them
with `Zephyr COMPONENTS unittest`.
Signed-off-by: Yuval Peress <peress@google.com>
Adding cmake_minimum_required() as this is required by CMake.
CMP0000 is a deprecated policy which allows to omit this function call,
however doing so will result in CMake printing a warning.
Adding cmake_minimum_required() to tests missing this call will remove
the warning and also allow us to remove the policy setting.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
The test infrastructure uses EXTRA_CPPFLAGS to control which
configuration is used, but this was also added to CMakeLists to ensure
a common optional infrastructure was always available. Since unit
tests don't use Kconfig, this actually prevented the test variants
from being selected.
Add the flag in the test itself, which works correctly since the test
includes the implementation directly.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
cbprintf should not pull in stdio.h unless it needs to, specifically
to get the FILE type for prototyping the stream substitutions. The
unit test assumes that these functions are always declared. For unit
testing where Kconfig isn't involved we need to tell the build system
to always provide them.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Tests for most paths through the conversion infrastructure. Expected
output can be validated with the host libc by setting USE_LIBC within
the source.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>