From 3e30e2edddf4ee00fc573902aaba8f18e95bd358 Mon Sep 17 00:00:00 2001 From: Chris Friedt Date: Sat, 17 May 2025 21:42:58 -0400 Subject: [PATCH] tests: lib: move time testsuite to c_lib Presumably the time testsuite was separate from the c library set of testsuites because it had a depedency on POSIX. Since that dependency no longer exists, colocate the time testsuite with the other c library testsuites. Signed-off-by: Chris Friedt --- MAINTAINERS.yml | 1 - tests/lib/{ => c_lib}/time/CMakeLists.txt | 0 tests/lib/c_lib/time/prj.conf | 2 ++ tests/lib/{ => c_lib}/time/src/main.c | 8 +++----- tests/lib/{ => c_lib}/time/testcase.yaml | 0 tests/lib/time/prj.conf | 4 ---- 6 files changed, 5 insertions(+), 10 deletions(-) rename tests/lib/{ => c_lib}/time/CMakeLists.txt (100%) create mode 100644 tests/lib/c_lib/time/prj.conf rename tests/lib/{ => c_lib}/time/src/main.c (83%) rename tests/lib/{ => c_lib}/time/testcase.yaml (100%) delete mode 100644 tests/lib/time/prj.conf diff --git a/MAINTAINERS.yml b/MAINTAINERS.yml index db87c7a143d..b7ce60cd3a1 100644 --- a/MAINTAINERS.yml +++ b/MAINTAINERS.yml @@ -2587,7 +2587,6 @@ Utilities: - tests/unit/list/ - tests/unit/intmath/ - tests/unit/pot/ - - tests/lib/time/ - tests/lib/onoff/ - tests/lib/sys_util/ - tests/lib/sprintf/ diff --git a/tests/lib/time/CMakeLists.txt b/tests/lib/c_lib/time/CMakeLists.txt similarity index 100% rename from tests/lib/time/CMakeLists.txt rename to tests/lib/c_lib/time/CMakeLists.txt diff --git a/tests/lib/c_lib/time/prj.conf b/tests/lib/c_lib/time/prj.conf new file mode 100644 index 00000000000..97b1a4e7da2 --- /dev/null +++ b/tests/lib/c_lib/time/prj.conf @@ -0,0 +1,2 @@ +CONFIG_ZTEST=y +CONFIG_PICOLIBC=y diff --git a/tests/lib/time/src/main.c b/tests/lib/c_lib/time/src/main.c similarity index 83% rename from tests/lib/time/src/main.c rename to tests/lib/c_lib/time/src/main.c index 227ed25131f..e7346738a16 100644 --- a/tests/lib/time/src/main.c +++ b/tests/lib/c_lib/time/src/main.c @@ -37,7 +37,7 @@ ZTEST(libc_time, test_time_passing) time_current = time(NULL); zassert_equal(time_current, time_initial + i, "Current time (%d) does not match expected time (%d)", - (int) time_current, (int) (time_initial + i)); + (int)time_current, (int)(time_initial + i)); } } @@ -49,14 +49,12 @@ ZTEST(libc_time, test_time_param) time_result = time(&time_param); - zassert_equal(time_result, time_param, - "time() result does not match param value"); + zassert_equal(time_result, time_param, "time() result does not match param value"); for (i = 0; i < 10; i++) { k_sleep(K_SECONDS(1)); - zassert_equal(time_result, time_param, - "time() result does not match param value"); + zassert_equal(time_result, time_param, "time() result does not match param value"); } } diff --git a/tests/lib/time/testcase.yaml b/tests/lib/c_lib/time/testcase.yaml similarity index 100% rename from tests/lib/time/testcase.yaml rename to tests/lib/c_lib/time/testcase.yaml diff --git a/tests/lib/time/prj.conf b/tests/lib/time/prj.conf deleted file mode 100644 index dd87f5a1338..00000000000 --- a/tests/lib/time/prj.conf +++ /dev/null @@ -1,4 +0,0 @@ -CONFIG_ZTEST=y -CONFIG_POSIX_TIMERS=y -CONFIG_XSI_SINGLE_PROCESS=y -CONFIG_PICOLIBC=y