Browse Source

esp32: move remaining tests

Renz Bagaporo 4 năm trước cách đây
mục cha
commit
fddc0b6799

+ 0 - 7
components/esp32/test/CMakeLists.txt

@@ -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()

+ 0 - 8
components/esp32/test/component.mk

@@ -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 := .

+ 0 - 9
components/esp32c3/test/CMakeLists.txt

@@ -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()

+ 0 - 4
components/esp32c3/test/component.mk

@@ -1,4 +0,0 @@
-#
-# Component Makefile (not used for tests, but CI checks test parity between GNU Make & CMake)
-#
-COMPONENT_CONFIG_ONLY := 1

+ 0 - 6
components/esp32s2/test/CMakeLists.txt

@@ -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()

+ 0 - 4
components/esp32s2/test/component.mk

@@ -1,4 +0,0 @@
-#
-# Component Makefile
-#
-COMPONENT_CONFIG_ONLY := 1

+ 2 - 0
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")

+ 1 - 1
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

+ 6 - 0
components/esp32/test/test_ahb_arb.c → 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 <esp_types.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -292,3 +296,5 @@ TEST_CASE("S32C1I vs AHB test (needs I2S)", "[hw][ignore]")
         vTaskDelete(th[i]);
     }
 }
+
+#endif // CONFIG_IDF_TARGET_ESP32

+ 6 - 0
components/esp32/test/test_ahb_arb_asm.S → 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

+ 5 - 0
components/esp32/test/test_fastbus.c → 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 <stdio.h>
 
@@ -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

+ 6 - 0
components/esp32/test/test_fastbus_asm.S → 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

+ 6 - 0
components/esp32/test/test_fp.c → 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 <math.h>
 #include <stdio.h>
 #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

+ 7 - 0
components/esp32/test/test_tsens.c → 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 <stdio.h>
 #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

+ 6 - 0
components/esp32/test/test_unal_dma.c → 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 <esp_types.h>
 #include <stdio.h>
@@ -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

+ 5 - 0
components/esp32/test/test_backtrace.c → components/esp_system/test/test_backtrace.c

@@ -10,6 +10,9 @@
  */
 #include <stdlib.h>
 #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