ztest: Add Z_TEST_SKIP_IFDEF macro

Defined Z_TEST_SKIP_IFDEF macro to skip tests when specified
config is enabled.

Signed-off-by: Al Semjonovs <asemjonovs@google.com>
This commit is contained in:
Al Semjonovs 2022-04-15 11:59:07 -06:00 committed by Anas Nashif
commit fef6e46f01
4 changed files with 38 additions and 0 deletions

View file

@ -210,6 +210,16 @@ static inline void unit_test_noop(void)
#define Z_ZTEST(suite, fn, t_options) Z_TEST(suite, fn, t_options, 0)
#define Z_ZTEST_F(suite, fn, t_options) Z_TEST(suite, fn, t_options, 1)
/**
* @brief Skips the test if config is enabled
*
* Use this macro at the start of your test case, to skip it when
* config is enabled. Useful when your test is still under development.
*
* @param config The Kconfig option used to skip the test.
*/
#define Z_TEST_SKIP_IFDEF(config) COND_CODE_1(config, (ztest_test_skip()), ())
/**
* @brief Create and register a new unit test.
*