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

9
tests/ztest/base/Kconfig Normal file
View file

@ -0,0 +1,9 @@
# Copyright 2022 Google LLC
#
# SPDX-License-Identifier: Apache-2.0
config BUGxxxxx
bool
default y
source "Kconfig.zephyr"

View file

@ -35,6 +35,12 @@ ZTEST(framework_tests, test_assert_mem_equal)
zassert_mem_equal(actual, expected, sizeof(expected), NULL);
}
ZTEST(framework_tests, test_skip_config)
{
Z_TEST_SKIP_IFDEF(CONFIG_BUGxxxxx);
zassert_true(false, NULL);
}
/***************************************************************************************************
* Sample fixture tests
**************************************************************************************************/