tests: subsys: logging: move log_immediate to new ztest API

Move test subsys/logging/log_immediate to use new ztest API.

Signed-off-by: li biao <biao1x.li@intel.com>
This commit is contained in:
li biao 2022-08-10 14:16:55 +08:00 committed by Carles Cufí
parent 0ee00080d9
commit 8bc0b2263f
2 changed files with 3 additions and 8 deletions

View file

@ -1,4 +1,5 @@
CONFIG_MAIN_THREAD_PRIORITY=5
CONFIG_ZTEST_NEW_API=y
CONFIG_ZTEST=y
CONFIG_TEST_LOGGING_DEFAULTS=n
CONFIG_LOG=y

View file

@ -54,7 +54,7 @@ static void thread_func(void *p1, void *p2, void *p3)
* preempted during logging (in immediate mode). Test checks that system does
* not hit any assert or other fault during frequent preemptions.
*/
static void test_log_immediate_preemption(void)
ZTEST(log_immediate, test_log_immediate_preemption)
{
if (!IS_ENABLED(CONFIG_LOG_IMMEDIATE_CLEAN_OUTPUT)) {
LOG_INF("CONFIG_LOG_IMMEDIATE_CLEAN_OUTPUT not enabled."
@ -74,10 +74,4 @@ static void test_log_immediate_preemption(void)
zassert_true(true, "");
}
/*test case main entry*/
void test_main(void)
{
ztest_test_suite(test_log_immediate,
ztest_unit_test(test_log_immediate_preemption));
ztest_run_test_suite(test_log_immediate);
}
ZTEST_SUITE(log_immediate, NULL, NULL, NULL, NULL, NULL);