tests: kernel: no-multithreading: Use tc_util.h

The comment in this test says that it cannot use ztest, as the latter
spawns some threads. However, still format the output in a way
compatible with ztest output, by using tc_util.h macros. This is
similar to a few other tests which can't use ztest library directly.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
This commit is contained in:
Paul Sokolovsky 2021-04-27 19:31:46 +03:00 committed by Anas Nashif
commit bb77186cc6

View file

@ -4,15 +4,21 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
#include <zephyr.h> #include <zephyr.h>
#include <tc_util.h>
/* The only point to CONFIG_MULTITHREADING=n is to use Zephyr's /* The only point to CONFIG_MULTITHREADING=n is to use Zephyr's
* multiplatform toolchain, linkage and boostrap integration to arrive * multiplatform toolchain, linkage and boostrap integration to arrive
* here so the user can run C code unimpeded. In general, we don't * here so the user can run C code unimpeded. In general, we don't
* promise that *any* Zephyr APIs are going to work properly, so don't * promise that *any* Zephyr APIs are going to work properly, so don't
* try to test any. That means we can't even use the ztest suite * try to test any. That means we can't even use the ztest suite
* framework (which spawns threads internally). * framework (which spawns threads internally). Instead, just use
* tc_util.h helpers.
*/ */
void test_main(void) void test_main(void)
{ {
TC_SUITE_START("test_kernel_no_multithread");
TC_START(__func__);
printk("It works\n"); printk("It works\n");
TC_END_RESULT(TC_PASS);
TC_SUITE_END("test_kernel_no_multithread", TC_PASS);
} }