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:
Anas Nashif 2019-09-25 13:52:51 -04:00
commit e9156e04b4
8 changed files with 44 additions and 13 deletions

View file

@ -18,11 +18,8 @@ target_sources(app PRIVATE
src/atomic.c
src/byteorder.c
src/clock.c
src/dlist.c
src/intmath.c
src/main.c
src/slist.c
src/sflist.c
src/timeout_order.c
src/multilib.c
src/errno.c

View file

@ -27,9 +27,6 @@ extern void test_sys_put_le64(void);
extern void test_atomic(void);
extern void test_intmath(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_clock_cycle(void);
extern void test_clock_uptime(void);
@ -122,9 +119,6 @@ void test_main(void)
ztest_user_unit_test(test_atomic),
ztest_unit_test(test_bitfield),
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_timeout_order),
ztest_1cpu_user_unit_test(test_clock_uptime),

View 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)

View file

@ -162,7 +162,7 @@ static inline bool verify_tail_head(sys_dlist_t *list,
return true;
}
/**
* @addtogroup kernel_common_tests
* @addtogroup unit_tests
* @{
*/
@ -177,7 +177,8 @@ void test_dlist(void)
{
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 */
sys_dlist_append(&test_list, &test_node_1.node);

23
tests/unit/list/main.c Normal file
View 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);
}

View file

@ -182,7 +182,8 @@ void test_sflist(void)
{
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 */
sys_sflist_append(&test_list, &test_node_1.node);

View file

@ -182,7 +182,8 @@ void test_slist(void)
{
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 */
sys_slist_append(&test_list, &test_node_1.node);

View file

@ -0,0 +1,4 @@
tests:
utilities.lists:
tags: utils lists
type: unit