From 874d10ce11302d6deca7a75458e75858a5eebdf2 Mon Sep 17 00:00:00 2001 From: Jakob Hasse Date: Fri, 8 Dec 2023 17:25:29 +0800 Subject: [PATCH] refactor(esp_system): moved shared stack tests from newlib to here --- .../test_apps/esp_system_unity_tests/main/CMakeLists.txt | 1 + .../main/test_shared_stack_printf.c | 7 ++++++- components/newlib/test_apps/newlib/main/CMakeLists.txt | 1 - 3 files changed, 7 insertions(+), 2 deletions(-) rename components/{newlib/test_apps/newlib => esp_system/test_apps/esp_system_unity_tests}/main/test_shared_stack_printf.c (85%) diff --git a/components/esp_system/test_apps/esp_system_unity_tests/main/CMakeLists.txt b/components/esp_system/test_apps/esp_system_unity_tests/main/CMakeLists.txt index 3e822ddec1..534f1270ad 100644 --- a/components/esp_system/test_apps/esp_system_unity_tests/main/CMakeLists.txt +++ b/components/esp_system/test_apps/esp_system_unity_tests/main/CMakeLists.txt @@ -10,6 +10,7 @@ set(SRC "test_app_main.c" "test_delay.c" "test_ipc.c" "test_reset_reason.c" + "test_shared_stack_printf.c" "test_sleep.c" "test_stack_check.c" "test_system_time.c" diff --git a/components/newlib/test_apps/newlib/main/test_shared_stack_printf.c b/components/esp_system/test_apps/esp_system_unity_tests/main/test_shared_stack_printf.c similarity index 85% rename from components/newlib/test_apps/newlib/main/test_shared_stack_printf.c rename to components/esp_system/test_apps/esp_system_unity_tests/main/test_shared_stack_printf.c index 0fd2e0742f..a2a85850ef 100644 --- a/components/newlib/test_apps/newlib/main/test_shared_stack_printf.c +++ b/components/esp_system/test_apps/esp_system_unity_tests/main/test_shared_stack_printf.c @@ -13,6 +13,10 @@ #include "test_utils.h" #include "esp_expression_with_stack.h" +#if !TEMPORARY_DISABLED_FOR_TARGETS(ESP32P4) // TODO IDF-8832: RISC-V FPU does not work on shared stack, + // esp_execute_shared_stack_function might be deprecated because of + // the FPU issue and all the other issues with it. + #define SHARED_STACK_SIZE 8192 static StackType_t *shared_stack_sp = NULL; @@ -40,7 +44,7 @@ void another_external_stack_function(void) shared_stack_sp = (StackType_t *)esp_cpu_get_sp(); } -TEST_CASE("test printf using shared buffer stack", "[newlib]") +TEST_CASE("test printf using shared buffer stack", "[shared_stack]") { StackType_t *shared_stack = malloc(SHARED_STACK_SIZE); @@ -72,3 +76,4 @@ TEST_CASE("test printf using shared buffer stack", "[newlib]") vSemaphoreDelete(printf_lock); free(shared_stack); } +#endif // !TEMPORARY_DISABLED_FOR_TARGETS(ESP32P4) diff --git a/components/newlib/test_apps/newlib/main/CMakeLists.txt b/components/newlib/test_apps/newlib/main/CMakeLists.txt index f59798a87a..afd52fc047 100644 --- a/components/newlib/test_apps/newlib/main/CMakeLists.txt +++ b/components/newlib/test_apps/newlib/main/CMakeLists.txt @@ -6,7 +6,6 @@ idf_component_register(SRCS "test_misc.c" "test_newlib.c" "test_setjmp.c" - "test_shared_stack_printf.c" "test_stdatomic.c" "test_time.c" PRIV_REQUIRES unity vfs cmock driver esp_timer spi_flash test_utils pthread esp_psram