zephyr/tests/ztest/custom_output/src/main.c
Torstein Grindvik d888e012ed subsys/testsuite: make tc_util overridable
A Kconfig boolean is added to allow users to provide their own
output strings when running tests via ztest.
This allows changing e.g. the PASS/FAIL/SKIPPED strings,
add counters, change separators, and similar.

A test using the feature and relevant documentation is added.

Signed-off-by: Torstein Grindvik <torstein.grindvik@nordicsemi.no>
2019-09-17 07:11:33 +08:00

34 lines
596 B
C

/*
* Copyright (c) 2016 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <ztest.h>
static void test_assert_pass(void)
{
ztest_test_pass();
}
static void test_assert_skip(void)
{
ztest_test_skip();
}
/*
* Same tests called several times to show custom handling of output.
*/
void test_main(void)
{
ztest_test_suite(framework_tests,
ztest_unit_test(test_assert_pass),
ztest_unit_test(test_assert_pass),
ztest_unit_test(test_assert_pass),
ztest_unit_test(test_assert_skip),
ztest_unit_test(test_assert_skip)
);
ztest_run_test_suite(framework_tests);
}