tests: move list test to be unit tests
Move to a unit test, no need to build this for every platform we have. Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
parent
cd60bd96ac
commit
e9156e04b4
8 changed files with 44 additions and 13 deletions
|
@ -18,11 +18,8 @@ target_sources(app PRIVATE
|
||||||
src/atomic.c
|
src/atomic.c
|
||||||
src/byteorder.c
|
src/byteorder.c
|
||||||
src/clock.c
|
src/clock.c
|
||||||
src/dlist.c
|
|
||||||
src/intmath.c
|
src/intmath.c
|
||||||
src/main.c
|
src/main.c
|
||||||
src/slist.c
|
|
||||||
src/sflist.c
|
|
||||||
src/timeout_order.c
|
src/timeout_order.c
|
||||||
src/multilib.c
|
src/multilib.c
|
||||||
src/errno.c
|
src/errno.c
|
||||||
|
|
|
@ -27,9 +27,6 @@ extern void test_sys_put_le64(void);
|
||||||
extern void test_atomic(void);
|
extern void test_atomic(void);
|
||||||
extern void test_intmath(void);
|
extern void test_intmath(void);
|
||||||
extern void test_printk(void);
|
extern void test_printk(void);
|
||||||
extern void test_slist(void);
|
|
||||||
extern void test_sflist(void);
|
|
||||||
extern void test_dlist(void);
|
|
||||||
extern void test_timeout_order(void);
|
extern void test_timeout_order(void);
|
||||||
extern void test_clock_cycle(void);
|
extern void test_clock_cycle(void);
|
||||||
extern void test_clock_uptime(void);
|
extern void test_clock_uptime(void);
|
||||||
|
@ -122,9 +119,6 @@ void test_main(void)
|
||||||
ztest_user_unit_test(test_atomic),
|
ztest_user_unit_test(test_atomic),
|
||||||
ztest_unit_test(test_bitfield),
|
ztest_unit_test(test_bitfield),
|
||||||
ztest_unit_test(test_printk),
|
ztest_unit_test(test_printk),
|
||||||
ztest_unit_test(test_slist),
|
|
||||||
ztest_unit_test(test_sflist),
|
|
||||||
ztest_unit_test(test_dlist),
|
|
||||||
ztest_unit_test(test_intmath),
|
ztest_unit_test(test_intmath),
|
||||||
ztest_unit_test(test_timeout_order),
|
ztest_unit_test(test_timeout_order),
|
||||||
ztest_1cpu_user_unit_test(test_clock_uptime),
|
ztest_1cpu_user_unit_test(test_clock_uptime),
|
||||||
|
|
10
tests/unit/list/CMakeLists.txt
Normal file
10
tests/unit/list/CMakeLists.txt
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
project(list)
|
||||||
|
set(SOURCES
|
||||||
|
main.c
|
||||||
|
slist.c
|
||||||
|
dlist.c
|
||||||
|
sflist.c
|
||||||
|
)
|
||||||
|
include($ENV{ZEPHYR_BASE}/subsys/testsuite/unittest.cmake)
|
|
@ -162,7 +162,7 @@ static inline bool verify_tail_head(sys_dlist_t *list,
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @addtogroup kernel_common_tests
|
* @addtogroup unit_tests
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -177,7 +177,8 @@ void test_dlist(void)
|
||||||
{
|
{
|
||||||
sys_dlist_init(&test_list);
|
sys_dlist_init(&test_list);
|
||||||
|
|
||||||
zassert_true((verify_emptyness(&test_list)), "test_list should be empty");
|
zassert_true((verify_emptyness(&test_list)),
|
||||||
|
"test_list should be empty");
|
||||||
|
|
||||||
/* Appending node 1 */
|
/* Appending node 1 */
|
||||||
sys_dlist_append(&test_list, &test_node_1.node);
|
sys_dlist_append(&test_list, &test_node_1.node);
|
23
tests/unit/list/main.c
Normal file
23
tests/unit/list/main.c
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2017 Intel Corporation
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <ztest.h>
|
||||||
|
|
||||||
|
extern void test_slist(void);
|
||||||
|
extern void test_sflist(void);
|
||||||
|
extern void test_dlist(void);
|
||||||
|
|
||||||
|
void test_main(void)
|
||||||
|
{
|
||||||
|
ztest_test_suite(dlist,
|
||||||
|
ztest_unit_test(test_dlist),
|
||||||
|
ztest_unit_test(test_slist),
|
||||||
|
ztest_unit_test(test_sflist)
|
||||||
|
);
|
||||||
|
|
||||||
|
ztest_run_test_suite(dlist);
|
||||||
|
}
|
||||||
|
|
|
@ -182,7 +182,8 @@ void test_sflist(void)
|
||||||
{
|
{
|
||||||
sys_sflist_init(&test_list);
|
sys_sflist_init(&test_list);
|
||||||
|
|
||||||
zassert_true((verify_emptyness(&test_list)), "test_list should be empty");
|
zassert_true((verify_emptyness(&test_list)),
|
||||||
|
"test_list should be empty");
|
||||||
|
|
||||||
/* Appending node 1 */
|
/* Appending node 1 */
|
||||||
sys_sflist_append(&test_list, &test_node_1.node);
|
sys_sflist_append(&test_list, &test_node_1.node);
|
|
@ -182,7 +182,8 @@ void test_slist(void)
|
||||||
{
|
{
|
||||||
sys_slist_init(&test_list);
|
sys_slist_init(&test_list);
|
||||||
|
|
||||||
zassert_true((verify_emptyness(&test_list)), "test_list should be empty");
|
zassert_true((verify_emptyness(&test_list)),
|
||||||
|
"test_list should be empty");
|
||||||
|
|
||||||
/* Appending node 1 */
|
/* Appending node 1 */
|
||||||
sys_slist_append(&test_list, &test_node_1.node);
|
sys_slist_append(&test_list, &test_node_1.node);
|
4
tests/unit/list/testcase.yaml
Normal file
4
tests/unit/list/testcase.yaml
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
tests:
|
||||||
|
utilities.lists:
|
||||||
|
tags: utils lists
|
||||||
|
type: unit
|
Loading…
Add table
Add a link
Reference in a new issue