ztest: Add Z_TEST_SKIP_IFNDEF macro

Add macro Z_TEST_SKIP_IFNDEF which is used when you want to skip test
if configuration option is not enabled.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
This commit is contained in:
Andrei Emeltchenko 2022-07-06 16:18:46 +03:00 committed by Anas Nashif
commit 5b633db288

View file

@ -257,6 +257,17 @@ static inline void unit_test_noop(void)
*/
#define Z_TEST_SKIP_IFDEF(config) COND_CODE_1(config, (ztest_test_skip()), ())
/**
* @brief Skips the test if config is not enabled
*
* Use this macro at the start of your test case, to skip it when
* config is not enabled. Useful when your need to skip test if some
* conifiguration option is not enabled.
*
* @param config The Kconfig option used to skip the test (if not enabled).
*/
#define Z_TEST_SKIP_IFNDEF(config) COND_CODE_1(config, (), (ztest_test_skip()))
/**
* @brief Create and register a new unit test.
*