From 1caab558a13164d325e7bc49ee5ea9785925a64a Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Wed, 25 Sep 2019 13:58:09 -0400 Subject: [PATCH] tests: move intmath 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 --- tests/kernel/common/CMakeLists.txt | 1 - tests/kernel/common/src/main.c | 2 -- tests/unit/intmath/CMakeLists.txt | 7 +++++++ .../common/src/intmath.c => unit/intmath/main.c} | 11 +++++++++++ tests/unit/intmath/testcase.yaml | 4 ++++ 5 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 tests/unit/intmath/CMakeLists.txt rename tests/{kernel/common/src/intmath.c => unit/intmath/main.c} (94%) create mode 100644 tests/unit/intmath/testcase.yaml diff --git a/tests/kernel/common/CMakeLists.txt b/tests/kernel/common/CMakeLists.txt index a2b11e73d88..fdae0e0ca83 100644 --- a/tests/kernel/common/CMakeLists.txt +++ b/tests/kernel/common/CMakeLists.txt @@ -18,7 +18,6 @@ target_sources(app PRIVATE src/atomic.c src/byteorder.c src/clock.c - src/intmath.c src/main.c src/timeout_order.c src/multilib.c diff --git a/tests/kernel/common/src/main.c b/tests/kernel/common/src/main.c index aa66aa59db1..c85223b4217 100644 --- a/tests/kernel/common/src/main.c +++ b/tests/kernel/common/src/main.c @@ -25,7 +25,6 @@ extern void test_sys_put_le32(void); extern void test_sys_get_le64(void); 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_timeout_order(void); extern void test_clock_cycle(void); @@ -119,7 +118,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_intmath), ztest_unit_test(test_timeout_order), ztest_1cpu_user_unit_test(test_clock_uptime), ztest_unit_test(test_clock_cycle), diff --git a/tests/unit/intmath/CMakeLists.txt b/tests/unit/intmath/CMakeLists.txt new file mode 100644 index 00000000000..0a6c9fc90c1 --- /dev/null +++ b/tests/unit/intmath/CMakeLists.txt @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: Apache-2.0 + +project(base64) +set(SOURCES + main.c + ) +include($ENV{ZEPHYR_BASE}/subsys/testsuite/unittest.cmake) diff --git a/tests/kernel/common/src/intmath.c b/tests/unit/intmath/main.c similarity index 94% rename from tests/kernel/common/src/intmath.c rename to tests/unit/intmath/main.c index 6e10f0d83bd..47e29cdf515 100644 --- a/tests/kernel/common/src/intmath.c +++ b/tests/unit/intmath/main.c @@ -98,3 +98,14 @@ void test_intmath(void) /** * @} */ + + + +void test_main(void) +{ + ztest_test_suite(intmath, + ztest_unit_test(test_intmath) + ); + + ztest_run_test_suite(intmath); +} diff --git a/tests/unit/intmath/testcase.yaml b/tests/unit/intmath/testcase.yaml new file mode 100644 index 00000000000..617c8c24184 --- /dev/null +++ b/tests/unit/intmath/testcase.yaml @@ -0,0 +1,4 @@ +tests: + utilities.intmath: + tags: util intmath + type: unit