ztest: fix ztest_run_test_suite usage and macros
Fix usage of ztest_run_test_suite that was missed when introducing shell support. Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
parent
8ca40e5ebf
commit
91841587d6
3 changed files with 4 additions and 50 deletions
|
|
@ -547,8 +547,8 @@ void ztest_simple_1cpu_after(void *data);
|
||||||
*
|
*
|
||||||
* @param suite Test suite to run.
|
* @param suite Test suite to run.
|
||||||
*/
|
*/
|
||||||
#define ztest_run_test_suite(suite) z_ztest_run_test_suite(STRINGIFY(suite), \
|
#define ztest_run_test_suite(suite, shuffle, suite_iter, case_iter) \
|
||||||
int suite_iter, int case_iter)
|
z_ztest_run_test_suite(STRINGIFY(suite), shuffle, suite_iter, case_iter)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Structure for architecture specific APIs
|
* @brief Structure for architecture specific APIs
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,8 @@
|
||||||
|
|
||||||
void test_main(void)
|
void test_main(void)
|
||||||
{
|
{
|
||||||
ztest_run_test_suite(timer_jitter_drift);
|
ztest_run_test_suite(timer_jitter_drift, false, 1, 1);
|
||||||
#ifndef CONFIG_TIMER_EXTERNAL_TEST
|
#ifndef CONFIG_TIMER_EXTERNAL_TEST
|
||||||
ztest_run_test_suite(timer_tick_train);
|
ztest_run_test_suite(timer_tick_train, false, 1, 1);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,46 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2016 Intel Corporation
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <zephyr/ztest.h>
|
|
||||||
|
|
||||||
static void test_empty_test(void)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
static void test_assert_tests(void)
|
|
||||||
{
|
|
||||||
zassert_true(1);
|
|
||||||
zassert_false(0);
|
|
||||||
zassert_is_null(NULL, NULL);
|
|
||||||
zassert_not_null("foo", NULL);
|
|
||||||
zassert_equal(1, 1);
|
|
||||||
zassert_equal_ptr(NULL, NULL, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void test_assert_mem_equal(void)
|
|
||||||
{
|
|
||||||
static const uint32_t expected[4] = {
|
|
||||||
0x1234,
|
|
||||||
0x5678,
|
|
||||||
0x9ABC,
|
|
||||||
0xDEF0
|
|
||||||
};
|
|
||||||
uint32_t actual[4] = {0};
|
|
||||||
|
|
||||||
memcpy(actual, expected, sizeof(actual));
|
|
||||||
zassert_mem_equal(actual, expected, sizeof(expected), NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
void test_main(void)
|
|
||||||
{
|
|
||||||
ztest_test_suite(framework_tests,
|
|
||||||
ztest_unit_test(test_empty_test),
|
|
||||||
ztest_unit_test(test_assert_tests),
|
|
||||||
ztest_unit_test(test_assert_mem_equal)
|
|
||||||
);
|
|
||||||
|
|
||||||
ztest_run_test_suite(framework_tests);
|
|
||||||
}
|
|
||||||
Loading…
Reference in a new issue