ztest: Give error if user has not defined CONFIG_ZTEST
If user is trying to use ztest by including ztest.h but has not defined CONFIG_ZTEST, then fail the compilation as the result binary will not do anything. There is no check for CONFIG_ZTEST for unit tests that are run without qemu. Change-Id: Ief9bba3a3a0f6acc6a264f17cde828b6d7e543a5 Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit is contained in:
parent
06685e75ae
commit
5d7a7c253a
|
@ -26,6 +26,7 @@ all: $(TARGET)
|
|||
|
||||
ZTEST = tests/ztest/src
|
||||
LIB += $(ZTEST)/ztest.o $(ZTEST)/ztest_mock.o
|
||||
CFLAGS += -DZTEST_UNITTEST
|
||||
|
||||
OBJS = $(addprefix $(O)/, $(OBJECTS) $(LIB))
|
||||
|
||||
|
|
|
@ -17,6 +17,10 @@
|
|||
* @defgroup ztest Zephyr testing suite
|
||||
*/
|
||||
|
||||
#if !defined(CONFIG_ZTEST) && !defined(ZTEST_UNITTEST)
|
||||
#error "You need to add CONFIG_ZTEST to your config file."
|
||||
#endif
|
||||
|
||||
#ifndef KERNEL
|
||||
#define CONFIG_STDOUT_CONSOLE 1
|
||||
#define CONFIG_ZTEST_ASSERT_VERBOSE 1
|
||||
|
|
Loading…
Reference in a new issue