From fddc0b67994a282dd21eabd33dd545613e462dbb Mon Sep 17 00:00:00 2001 From: Renz Bagaporo Date: Tue, 6 Apr 2021 20:38:34 +0800 Subject: [PATCH] esp32: move remaining tests --- components/esp32/test/CMakeLists.txt | 7 ------- components/esp32/test/component.mk | 8 -------- components/esp32c3/test/CMakeLists.txt | 9 --------- components/esp32c3/test/component.mk | 4 ---- components/esp32s2/test/CMakeLists.txt | 6 ------ components/esp32s2/test/component.mk | 4 ---- components/esp_hw_support/test/CMakeLists.txt | 2 ++ components/esp_hw_support/test/component.mk | 2 +- components/{esp32 => esp_hw_support}/test/test_ahb_arb.c | 6 ++++++ .../{esp32 => esp_hw_support}/test/test_ahb_arb_asm.S | 6 ++++++ components/{esp32 => esp_hw_support}/test/test_fastbus.c | 5 +++++ .../{esp32 => esp_hw_support}/test/test_fastbus_asm.S | 6 ++++++ components/{esp32 => esp_hw_support}/test/test_fp.c | 6 ++++++ components/{esp32 => esp_hw_support}/test/test_tsens.c | 7 +++++++ .../{esp32 => esp_hw_support}/test/test_unal_dma.c | 6 ++++++ components/{esp32 => esp_system}/test/test_backtrace.c | 5 +++++ 16 files changed, 50 insertions(+), 39 deletions(-) delete mode 100644 components/esp32/test/CMakeLists.txt delete mode 100644 components/esp32/test/component.mk delete mode 100644 components/esp32c3/test/CMakeLists.txt delete mode 100644 components/esp32c3/test/component.mk delete mode 100644 components/esp32s2/test/CMakeLists.txt delete mode 100644 components/esp32s2/test/component.mk rename components/{esp32 => esp_hw_support}/test/test_ahb_arb.c (99%) rename components/{esp32 => esp_hw_support}/test/test_ahb_arb_asm.S (90%) rename components/{esp32 => esp_hw_support}/test/test_fastbus.c (97%) rename components/{esp32 => esp_hw_support}/test/test_fastbus_asm.S (91%) rename components/{esp32 => esp_hw_support}/test/test_fp.c (98%) rename components/{esp32 => esp_hw_support}/test/test_tsens.c (91%) rename components/{esp32 => esp_hw_support}/test/test_unal_dma.c (98%) rename components/{esp32 => esp_system}/test/test_backtrace.c (99%) diff --git a/components/esp32/test/CMakeLists.txt b/components/esp32/test/CMakeLists.txt deleted file mode 100644 index 7c26dc0ace..0000000000 --- a/components/esp32/test/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -if(IDF_TARGET STREQUAL "esp32") - idf_component_register(SRC_DIRS . - PRIV_INCLUDE_DIRS . - PRIV_REQUIRES cmock test_utils mbedtls ulp esp_common - ) - target_link_libraries(${COMPONENT_LIB} INTERFACE "-u ld_include_test_dport_xt_highint5") -endif() diff --git a/components/esp32/test/component.mk b/components/esp32/test/component.mk deleted file mode 100644 index b68857397e..0000000000 --- a/components/esp32/test/component.mk +++ /dev/null @@ -1,8 +0,0 @@ -# -#Component Makefile -# - -COMPONENT_ADD_LDFLAGS = -Wl,--whole-archive -l$(COMPONENT_NAME) -Wl,--no-whole-archive \ - -u ld_include_test_dport_xt_highint5 \ - -COMPONENT_SRCDIRS := . diff --git a/components/esp32c3/test/CMakeLists.txt b/components/esp32c3/test/CMakeLists.txt deleted file mode 100644 index 068a0a8549..0000000000 --- a/components/esp32c3/test/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -if(IDF_TARGET STREQUAL "esp32c3") - idf_component_register(SRC_DIRS . - INCLUDE_DIRS . ${CMAKE_CURRENT_BINARY_DIR} - REQUIRES unity test_utils esp_common mbedtls - ) - - idf_build_set_property(COMPILE_DEFINITIONS "-DESP_TIMER_DYNAMIC_OVERFLOW_VAL" APPEND) - target_link_libraries(${COMPONENT_LIB} INTERFACE "-u ld_include_test_dport_xt_highint5") -endif() diff --git a/components/esp32c3/test/component.mk b/components/esp32c3/test/component.mk deleted file mode 100644 index d2183390cc..0000000000 --- a/components/esp32c3/test/component.mk +++ /dev/null @@ -1,4 +0,0 @@ -# -# Component Makefile (not used for tests, but CI checks test parity between GNU Make & CMake) -# -COMPONENT_CONFIG_ONLY := 1 diff --git a/components/esp32s2/test/CMakeLists.txt b/components/esp32s2/test/CMakeLists.txt deleted file mode 100644 index ef9c05cd50..0000000000 --- a/components/esp32s2/test/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -if(IDF_TARGET STREQUAL "esp32s2") - idf_component_register(SRC_DIRS . - PRIV_INCLUDE_DIRS . - PRIV_REQUIRES cmock test_utils nvs_flash mbedtls ulp esp_common - ) -endif() diff --git a/components/esp32s2/test/component.mk b/components/esp32s2/test/component.mk deleted file mode 100644 index a2f7dc1797..0000000000 --- a/components/esp32s2/test/component.mk +++ /dev/null @@ -1,4 +0,0 @@ -# -# Component Makefile -# -COMPONENT_CONFIG_ONLY := 1 diff --git a/components/esp_hw_support/test/CMakeLists.txt b/components/esp_hw_support/test/CMakeLists.txt index bc0b3bc550..943d1e3102 100644 --- a/components/esp_hw_support/test/CMakeLists.txt +++ b/components/esp_hw_support/test/CMakeLists.txt @@ -1,3 +1,5 @@ idf_component_register(SRC_DIRS "." PRIV_INCLUDE_DIRS "${include_dirs}" PRIV_REQUIRES cmock test_utils esp_hw_support driver efuse) + + target_link_libraries(${COMPONENT_LIB} INTERFACE "-u ld_include_test_dport_xt_highint5") diff --git a/components/esp_hw_support/test/component.mk b/components/esp_hw_support/test/component.mk index 2efee8e81c..342bed67fe 100644 --- a/components/esp_hw_support/test/component.mk +++ b/components/esp_hw_support/test/component.mk @@ -1,3 +1,3 @@ COMPONENT_SRCDIRS := . -COMPONENT_ADD_LDFLAGS = -Wl,--whole-archive -l$(COMPONENT_NAME) -Wl,--no-whole-archive +COMPONENT_ADD_LDFLAGS = -Wl,--whole-archive -l$(COMPONENT_NAME) -Wl,--no-whole-archive -u ld_include_test_dport_xt_highint5 diff --git a/components/esp32/test/test_ahb_arb.c b/components/esp_hw_support/test/test_ahb_arb.c similarity index 99% rename from components/esp32/test/test_ahb_arb.c rename to components/esp_hw_support/test/test_ahb_arb.c index f4ccfbe37b..65bea41cbc 100644 --- a/components/esp32/test/test_ahb_arb.c +++ b/components/esp_hw_support/test/test_ahb_arb.c @@ -4,6 +4,10 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include "sdkconfig.h" + +#if CONFIG_IDF_TARGET_ESP32 + #include #include #include @@ -292,3 +296,5 @@ TEST_CASE("S32C1I vs AHB test (needs I2S)", "[hw][ignore]") vTaskDelete(th[i]); } } + +#endif // CONFIG_IDF_TARGET_ESP32 diff --git a/components/esp32/test/test_ahb_arb_asm.S b/components/esp_hw_support/test/test_ahb_arb_asm.S similarity index 90% rename from components/esp32/test/test_ahb_arb_asm.S rename to components/esp_hw_support/test/test_ahb_arb_asm.S index 1e9214c199..981fc3cac4 100644 --- a/components/esp32/test/test_ahb_arb_asm.S +++ b/components/esp_hw_support/test/test_ahb_arb_asm.S @@ -1,3 +1,7 @@ +#include "sdkconfig.h" + +#if CONFIG_IDF_TARGET_ESP32 + /* This little bit of code is executed in-place by one CPU, but copied to a different memory region by the other CPU. Make sure it stays position-independent. @@ -49,3 +53,5 @@ unlockloop: bne a3, a6, unlockloop retw + +#endif // CONFIG_IDF_TARGET_ESP32 diff --git a/components/esp32/test/test_fastbus.c b/components/esp_hw_support/test/test_fastbus.c similarity index 97% rename from components/esp32/test/test_fastbus.c rename to components/esp_hw_support/test/test_fastbus.c index d3cbd6c289..2f03a39193 100644 --- a/components/esp32/test/test_fastbus.c +++ b/components/esp_hw_support/test/test_fastbus.c @@ -3,6 +3,9 @@ * * SPDX-License-Identifier: Apache-2.0 */ +#include "sdkconfig.h" + +#if CONFIG_IDF_TARGET_ESP32 #include @@ -134,3 +137,5 @@ TEST_CASE("Fast I/O bus test", "[hw][ignore]") } xt_ints_off(1 << ETS_UART0_INUM); } + +#endif // CONFIG_IDF_TARGET_ESP32 diff --git a/components/esp32/test/test_fastbus_asm.S b/components/esp_hw_support/test/test_fastbus_asm.S similarity index 91% rename from components/esp32/test/test_fastbus_asm.S rename to components/esp_hw_support/test/test_fastbus_asm.S index 1ced09fcf7..ccef358e21 100644 --- a/components/esp32/test/test_fastbus_asm.S +++ b/components/esp_hw_support/test/test_fastbus_asm.S @@ -1,3 +1,7 @@ +#include "sdkconfig.h" + +#if CONFIG_IDF_TARGET_ESP32 + /* This little bit of code is executed in-place by one CPU, but copied to a different memory region by the other CPU. Make sure it stays position-independent. @@ -30,3 +34,5 @@ predout: j back //loop again out: retw //and we are done + +#endif // CONFIG_IDF_TARGET_ESP32 diff --git a/components/esp32/test/test_fp.c b/components/esp_hw_support/test/test_fp.c similarity index 98% rename from components/esp32/test/test_fp.c rename to components/esp_hw_support/test/test_fp.c index 67996edbdc..774eb6cdde 100644 --- a/components/esp32/test/test_fp.c +++ b/components/esp_hw_support/test/test_fp.c @@ -3,6 +3,10 @@ * * SPDX-License-Identifier: Apache-2.0 */ +#include "sdkconfig.h" + +#if CONFIG_IDF_TARGET_ESP32 + #include #include #include "soc/cpu.h" @@ -272,3 +276,5 @@ TEST_CASE("floating point square root performance", "[fp]") TEST_PERFORMANCE_LESS_THAN(CYCLES_PER_SQRT, "%d cycles", cycles); } + +#endif // CONFIG_IDF_TARGET_ESP32 diff --git a/components/esp32/test/test_tsens.c b/components/esp_hw_support/test/test_tsens.c similarity index 91% rename from components/esp32/test/test_tsens.c rename to components/esp_hw_support/test/test_tsens.c index 938bfa2436..0eb016bc3b 100644 --- a/components/esp32/test/test_tsens.c +++ b/components/esp_hw_support/test/test_tsens.c @@ -3,6 +3,10 @@ * * SPDX-License-Identifier: Apache-2.0 */ +#include "sdkconfig.h" + +#if CONFIG_IDF_TARGET_ESP32 + #include #include "unity.h" #include "esp_rom_sys.h" @@ -23,3 +27,6 @@ TEST_CASE("can control TSENS using registers", "[rtc][ignore]") int res = GET_PERI_REG_BITS2(SENS_SAR_SLAVE_ADDR3_REG, SENS_TSENS_OUT, SENS_TSENS_OUT_S); printf("res=%d\n", res); } + + +#endif // CONFIG_IDF_TARGET_ESP32 diff --git a/components/esp32/test/test_unal_dma.c b/components/esp_hw_support/test/test_unal_dma.c similarity index 98% rename from components/esp32/test/test_unal_dma.c rename to components/esp_hw_support/test/test_unal_dma.c index 37e80a0330..c0f02a5434 100644 --- a/components/esp32/test/test_unal_dma.c +++ b/components/esp_hw_support/test/test_unal_dma.c @@ -3,6 +3,9 @@ * * SPDX-License-Identifier: Apache-2.0 */ +#include "sdkconfig.h" + +#if CONFIG_IDF_TARGET_ESP32 #include #include @@ -202,3 +205,6 @@ TEST_CASE("Unaligned DMA test (needs I2S)", "[hw][ignore]") dmaMemcpy(src, dest + 1, 2048 + 2); TEST_ASSERT(mymemcmp(src, dest + 1, 2048) == 0); } + + +#endif // CONFIG_IDF_TARGET_ESP32 diff --git a/components/esp32/test/test_backtrace.c b/components/esp_system/test/test_backtrace.c similarity index 99% rename from components/esp32/test/test_backtrace.c rename to components/esp_system/test/test_backtrace.c index 65fada5e7d..12018b4078 100644 --- a/components/esp32/test/test_backtrace.c +++ b/components/esp_system/test/test_backtrace.c @@ -10,6 +10,9 @@ */ #include #include "unity.h" + +#if __XTENSA__ + #include "freertos/FreeRTOS.h" #include "freertos/task.h" #include "freertos/xtensa_api.h" @@ -88,3 +91,5 @@ TEST_CASE("Test backtrace with a ROM function", "[reset_reason][reset=StoreProhi ets_install_putc1(&write_char_crash); esp_rom_printf("foo"); } + +#endif