diff --git a/testing/cmocka/Kconfig b/testing/cmocka/Kconfig index 7aebcde0c7..d56006251f 100644 --- a/testing/cmocka/Kconfig +++ b/testing/cmocka/Kconfig @@ -26,4 +26,8 @@ config TESTING_CMOCKA_STACKSIZE int "cmocka test stack size" default DEFAULT_TASK_STACKSIZE +config TESTING_CMOCKA_LEAKDETECT + bool "Memory leaks can be checked using cmocka, please use in local environment" + default n + endif diff --git a/testing/cmocka/Make.defs b/testing/cmocka/Make.defs index 1f1709a028..3086f8fcb1 100644 --- a/testing/cmocka/Make.defs +++ b/testing/cmocka/Make.defs @@ -22,4 +22,7 @@ ifneq ($(CONFIG_TESTING_CMOCKA),) CONFIGURED_APPS += $(APPDIR)/testing/cmocka CFLAGS += ${INCDIR_PREFIX}$(APPDIR)/testing/cmocka/cmocka/include CXXFLAGS += ${INCDIR_PREFIX}$(APPDIR)/testing/cmocka/cmocka/include +ifneq ($(CONFIG_TESTING_CMOCKA_LEAKDETECT),) +CFLAGS += -DUNIT_TESTING=ON +endif endif