From ed92ba1e24c909446e693b42192e4716ae664176 Mon Sep 17 00:00:00 2001 From: idy Date: Sun, 26 Jul 2026 10:31:44 +0800 Subject: [PATCH] fix(esp_libc): limit timespec_get test to picolibc The regression test was compiled by Newlib configurations even though that libc does not expose TIME_UTC or timespec_get in the selected toolchain. - Guard the test with CONFIG_LIBC_PICOLIBC - Label the case as a Picolibc-specific regression Generated with [Codex](https://github.com/openai) --- components/esp_libc/test_apps/newlib/main/test_time.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/esp_libc/test_apps/newlib/main/test_time.c b/components/esp_libc/test_apps/newlib/main/test_time.c index ffded3907ff..3c748a2cdac 100644 --- a/components/esp_libc/test_apps/newlib/main/test_time.c +++ b/components/esp_libc/test_apps/newlib/main/test_time.c @@ -548,7 +548,8 @@ TEST_CASE("test posix_timers clock_... functions", "[newlib]") test_posix_timers_clock(); } -TEST_CASE("timespec_get returns UTC time", "[newlib]") +#if CONFIG_LIBC_PICOLIBC +TEST_CASE("timespec_get returns UTC time", "[picolibc]") { struct timespec ts = {0}; @@ -558,6 +559,7 @@ TEST_CASE("timespec_get returns UTC time", "[newlib]") TEST_ASSERT_LESS_THAN_INT32(1000000000L, ts.tv_nsec); TEST_ASSERT_EQUAL_INT(0, timespec_get(&ts, -1)); } +#endif #define TEST_USE_CPU_CYCLES 1 #if TEST_USE_CPU_CYCLES && CONFIG_ESP_SYSTEM_SINGLE_CORE_MODE