Преглед изворни кода

driver: register test app component by WHOLE_ARCHIVE

morris пре 3 година
родитељ
комит
0a36cad9e0
28 измењених фајлова са 45 додато и 96 уклоњено
  1. 4 7
      components/driver/test_apps/gpio/main/CMakeLists.txt
  2. 0 4
      components/driver/test_apps/gpio/main/test_dedicated_gpio.c
  3. 0 4
      components/driver/test_apps/gpio/main/test_gpio.c
  4. 0 4
      components/driver/test_apps/gpio/main/test_sigmadelta.c
  5. 4 3
      components/driver/test_apps/gptimer/main/CMakeLists.txt
  6. 0 4
      components/driver/test_apps/gptimer/main/test_gptimer.c
  7. 0 4
      components/driver/test_apps/gptimer/main/test_gptimer_iram.c
  8. 4 3
      components/driver/test_apps/legacy_pcnt_driver/main/CMakeLists.txt
  9. 0 4
      components/driver/test_apps/legacy_pcnt_driver/main/test_legacy_pcnt.c
  10. 1 1
      components/driver/test_apps/legacy_pcnt_driver/pytest_legacy_pcnt.py
  11. 3 3
      components/driver/test_apps/legacy_rtc_temp_driver/main/CMakeLists.txt
  12. 0 4
      components/driver/test_apps/legacy_rtc_temp_driver/main/test_rtc_temp_driver.c
  13. 4 3
      components/driver/test_apps/legacy_timer_driver/main/CMakeLists.txt
  14. 0 4
      components/driver/test_apps/legacy_timer_driver/main/test_legacy_timer.c
  15. 4 3
      components/driver/test_apps/pulse_cnt/main/CMakeLists.txt
  16. 0 4
      components/driver/test_apps/pulse_cnt/main/test_pulse_cnt.c
  17. 1 1
      components/driver/test_apps/pulse_cnt/pytest_pulse_cnt.py
  18. 1 1
      components/driver/test_apps/temperature_sensor/CMakeLists.txt
  19. 3 3
      components/driver/test_apps/temperature_sensor/main/CMakeLists.txt
  20. 0 4
      components/driver/test_apps/temperature_sensor/main/test_temperature_sensor.c
  21. 4 3
      components/esp_lcd/test_apps/i2c_lcd/main/CMakeLists.txt
  22. 0 4
      components/esp_lcd/test_apps/i2c_lcd/main/test_i2c_lcd_panel.c
  23. 4 3
      components/esp_lcd/test_apps/i80_lcd/main/CMakeLists.txt
  24. 0 4
      components/esp_lcd/test_apps/i80_lcd/main/test_i80_lcd_panel.c
  25. 4 3
      components/esp_lcd/test_apps/rgb_lcd/main/CMakeLists.txt
  26. 0 4
      components/esp_lcd/test_apps/rgb_lcd/main/test_rgb_panel.c
  27. 4 3
      components/esp_lcd/test_apps/spi_lcd/main/CMakeLists.txt
  28. 0 4
      components/esp_lcd/test_apps/spi_lcd/main/test_spi_lcd_panel.c

+ 4 - 7
components/driver/test_apps/gpio/main/CMakeLists.txt

@@ -1,18 +1,15 @@
 set(srcs "test_app_main.c"
          "test_gpio.c")
 
-set(include_tests "-u test_app_include_gpio")
-
 if(CONFIG_SOC_DEDICATED_GPIO_SUPPORTED)
     list(APPEND srcs "test_dedicated_gpio.c")
-    list(APPEND include_tests "-u test_app_include_dedicated_gpio")
 endif()
 
 if(CONFIG_SOC_SIGMADELTA_SUPPORTED)
     list(APPEND srcs "test_sigmadelta.c")
-    list(APPEND include_tests "-u test_app_include_sigmadelta")
 endif()
 
-idf_component_register(SRCS ${srcs})
-
-target_link_libraries(${COMPONENT_LIB} INTERFACE ${include_tests})
+# In order for the cases defined by `TEST_CASE` to be linked into the final elf,
+# the component can be registered as WHOLE_ARCHIVE
+idf_component_register(SRCS ${srcs}
+                       WHOLE_ARCHIVE)

+ 0 - 4
components/driver/test_apps/gpio/main/test_dedicated_gpio.c

@@ -15,10 +15,6 @@
 #include "driver/gpio.h"
 #include "driver/dedic_gpio.h"
 
-void test_app_include_dedicated_gpio(void)
-{
-}
-
 TEST_CASE("Dedicated_GPIO_bundle_install/uninstall", "[dedic_gpio]")
 {
     const int test_gpios[SOC_DEDIC_GPIO_OUT_CHANNELS_NUM / 2] = {0};

+ 0 - 4
components/driver/test_apps/gpio/main/test_gpio.c

@@ -32,10 +32,6 @@
 #include "esp_spi_flash.h"
 #include "esp_attr.h"
 
-void test_app_include_gpio(void)
-{
-}
-
 // Enable internal routing for the output and input gpio pins
 #define TEST_GPIO_INTERNAL_ROUTING    1
 

+ 0 - 4
components/driver/test_apps/gpio/main/test_sigmadelta.c

@@ -10,10 +10,6 @@
 #include "soc/soc_caps.h"
 #include "driver/sigmadelta.h"
 
-void test_app_include_sigmadelta(void)
-{
-}
-
 TEST_CASE("SigmaDelta_config_test", "[sigma_delta]")
 {
     sigmadelta_config_t sigmadelta_cfg = {

+ 4 - 3
components/driver/test_apps/gptimer/main/CMakeLists.txt

@@ -2,6 +2,7 @@ set(srcs "test_app_main.c"
          "test_gptimer.c"
          "test_gptimer_iram.c")
 
-idf_component_register(SRCS ${srcs})
-
-target_link_libraries(${COMPONENT_LIB} INTERFACE "-u test_app_include_gptimer" "-u test_app_include_gptimer_iram")
+# In order for the cases defined by `TEST_CASE` to be linked into the final elf,
+# the component can be registered as WHOLE_ARCHIVE
+idf_component_register(SRCS ${srcs}
+                       WHOLE_ARCHIVE)

+ 0 - 4
components/driver/test_apps/gptimer/main/test_gptimer.c

@@ -19,10 +19,6 @@
 #define TEST_ALARM_CALLBACK_ATTR
 #endif // CONFIG_GPTIMER_ISR_IRAM_SAFE
 
-void test_app_include_gptimer(void)
-{
-}
-
 TEST_CASE("gptimer_set_get_raw_count", "[gptimer]")
 {
     gptimer_config_t config = {

+ 0 - 4
components/driver/test_apps/gptimer/main/test_gptimer_iram.c

@@ -14,10 +14,6 @@
 #include "esp_spi_flash.h"
 #include "soc/soc_caps.h"
 
-void test_app_include_gptimer_iram(void)
-{
-}
-
 #if CONFIG_GPTIMER_ISR_IRAM_SAFE
 
 typedef struct {

+ 4 - 3
components/driver/test_apps/legacy_pcnt_driver/main/CMakeLists.txt

@@ -1,6 +1,7 @@
 set(srcs "test_app_main.c"
          "test_legacy_pcnt.c")
 
-idf_component_register(SRCS ${srcs})
-
-target_link_libraries(${COMPONENT_LIB} INTERFACE "-u test_app_include_legacy_pcnt")
+# In order for the cases defined by `TEST_CASE` to be linked into the final elf,
+# the component can be registered as WHOLE_ARCHIVE
+idf_component_register(SRCS ${srcs}
+                       WHOLE_ARCHIVE)

+ 0 - 4
components/driver/test_apps/legacy_pcnt_driver/main/test_legacy_pcnt.c

@@ -666,7 +666,3 @@ TEST_CASE("PCNT_counting_mode_test", "[pcnt]")
     printf("PCNT mode test for negative count\n");
     count_mode_test(PCNT_CTRL_GND_IO);
 }
-
-void test_app_include_legacy_pcnt(void)
-{
-}

+ 1 - 1
components/driver/test_apps/legacy_pcnt_driver/pytest_legacy_pcnt.py

@@ -16,7 +16,7 @@ from pytest_embedded import Dut
     ],
     indirect=True,
 )
-def test_gptimer(dut: Dut) -> None:
+def test_legacy_pcnt(dut: Dut) -> None:
     dut.expect_exact('Press ENTER to see the list of tests')
     dut.write('*')
     dut.expect_unity_test_output(timeout=240)

+ 3 - 3
components/driver/test_apps/legacy_rtc_temp_driver/main/CMakeLists.txt

@@ -1,7 +1,7 @@
 set(srcs "test_app_main.c"
          "test_rtc_temp_driver.c")
 
+# In order for the cases defined by `TEST_CASE` to be linked into the final elf,
+# the component can be registered as WHOLE_ARCHIVE
 idf_component_register(SRCS ${srcs}
-                       PRIV_REQUIRES driver unity)
-
-target_link_libraries(${COMPONENT_LIB} INTERFACE "-u test_app_include_rtc_temp_driver")
+                       WHOLE_ARCHIVE)

+ 0 - 4
components/driver/test_apps/legacy_rtc_temp_driver/main/test_rtc_temp_driver.c

@@ -9,10 +9,6 @@
 #include "unity.h"
 #include "driver/temp_sensor.h"
 
-void test_app_include_rtc_temp_driver(void)
-{
-}
-
 TEST_CASE("Temperature_legacy_workflow_test", "[hw_timer]")
 {
     printf("Initializing Temperature sensor\n");

+ 4 - 3
components/driver/test_apps/legacy_timer_driver/main/CMakeLists.txt

@@ -1,6 +1,7 @@
 set(srcs "test_app_main.c"
          "test_legacy_timer.c")
 
-idf_component_register(SRCS ${srcs})
-
-target_link_libraries(${COMPONENT_LIB} INTERFACE "-u test_app_include_legacy_timer")
+# In order for the cases defined by `TEST_CASE` to be linked into the final elf,
+# the component can be registered as WHOLE_ARCHIVE
+idf_component_register(SRCS ${srcs}
+                       WHOLE_ARCHIVE)

+ 0 - 4
components/driver/test_apps/legacy_timer_driver/main/test_legacy_timer.c

@@ -1007,7 +1007,3 @@ TEST_CASE("Timer_check_reinitialization_sequence", "[hw_timer]")
     // The pending timer interrupt should not be triggered
     TEST_ASSERT_EQUAL(0, timer_group_get_intr_status_in_isr(TIMER_GROUP_0) & TIMER_INTR_T0);
 }
-
-void test_app_include_legacy_timer(void)
-{
-}

+ 4 - 3
components/driver/test_apps/pulse_cnt/main/CMakeLists.txt

@@ -1,6 +1,7 @@
 set(srcs "test_app_main.c"
          "test_pulse_cnt.c")
 
-idf_component_register(SRCS ${srcs})
-
-target_link_libraries(${COMPONENT_LIB} INTERFACE "-u test_app_include_pulse_cnt")
+# In order for the cases defined by `TEST_CASE` to be linked into the final elf,
+# the component can be registered as WHOLE_ARCHIVE
+idf_component_register(SRCS ${srcs}
+                       WHOLE_ARCHIVE)

+ 0 - 4
components/driver/test_apps/pulse_cnt/main/test_pulse_cnt.c

@@ -402,7 +402,3 @@ TEST_CASE("pcnt_zero_cross_mode", "[pcnt]")
     TEST_ESP_OK(pcnt_del_channel(channelB));
     TEST_ESP_OK(pcnt_del_unit(unit));
 }
-
-void test_app_include_pulse_cnt(void)
-{
-}

+ 1 - 1
components/driver/test_apps/pulse_cnt/pytest_pulse_cnt.py

@@ -17,7 +17,7 @@ from pytest_embedded import Dut
     ],
     indirect=True,
 )
-def test_gptimer(dut: Dut) -> None:
+def test_pulse_cnt(dut: Dut) -> None:
     dut.expect_exact('Press ENTER to see the list of tests')
     dut.write('*')
     dut.expect_unity_test_output()

+ 1 - 1
components/driver/test_apps/temperature_sensor/CMakeLists.txt

@@ -2,4 +2,4 @@
 cmake_minimum_required(VERSION 3.5)
 
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
-project(test_app_include_temperature_sensor)
+project(test_temperature_sensor)

+ 3 - 3
components/driver/test_apps/temperature_sensor/main/CMakeLists.txt

@@ -1,7 +1,7 @@
 set(srcs "test_app_main.c"
          "test_temperature_sensor.c")
 
+# In order for the cases defined by `TEST_CASE` to be linked into the final elf,
+# the component can be registered as WHOLE_ARCHIVE
 idf_component_register(SRCS ${srcs}
-                       PRIV_REQUIRES driver unity)
-
-target_link_libraries(${COMPONENT_LIB} INTERFACE "-u test_app_include_temperature_sensor")
+                       WHOLE_ARCHIVE)

+ 0 - 4
components/driver/test_apps/temperature_sensor/main/test_temperature_sensor.c

@@ -9,10 +9,6 @@
 #include "unity.h"
 #include "driver/temperature_sensor.h"
 
-void test_app_include_temperature_sensor(void)
-{
-}
-
 TEST_CASE("Temperature_sensor_driver_workflow_test", "[temperature_sensor]")
 {
     printf("Initializing Temperature sensor\n");

+ 4 - 3
components/esp_lcd/test_apps/i2c_lcd/main/CMakeLists.txt

@@ -1,6 +1,7 @@
 set(srcs "test_app_main.c"
          "test_i2c_lcd_panel.c")
 
-idf_component_register(SRCS ${srcs})
-
-target_link_libraries(${COMPONENT_LIB} INTERFACE "-u test_app_include_i2c_lcd")
+# In order for the cases defined by `TEST_CASE` to be linked into the final elf,
+# the component can be registered as WHOLE_ARCHIVE
+idf_component_register(SRCS ${srcs}
+                       WHOLE_ARCHIVE)

+ 0 - 4
components/esp_lcd/test_apps/i2c_lcd/main/test_i2c_lcd_panel.c

@@ -14,10 +14,6 @@
 #include "esp_system.h"
 #include "test_i2c_board.h"
 
-void test_app_include_i2c_lcd(void)
-{
-}
-
 TEST_CASE("lcd_panel_with_i2c_interface_(ssd1306)", "[lcd]")
 {
     const uint8_t pattern[][16] = {{

+ 4 - 3
components/esp_lcd/test_apps/i80_lcd/main/CMakeLists.txt

@@ -1,6 +1,7 @@
 set(srcs "test_app_main.c"
          "test_i80_lcd_panel.c")
 
-idf_component_register(SRCS ${srcs})
-
-target_link_libraries(${COMPONENT_LIB} INTERFACE "-u test_app_include_i80_lcd")
+# In order for the cases defined by `TEST_CASE` to be linked into the final elf,
+# the component can be registered as WHOLE_ARCHIVE
+idf_component_register(SRCS ${srcs}
+                       WHOLE_ARCHIVE)

+ 0 - 4
components/esp_lcd/test_apps/i80_lcd/main/test_i80_lcd_panel.c

@@ -17,10 +17,6 @@
 #include "driver/gpio.h"
 #include "test_i80_board.h"
 
-void test_app_include_i80_lcd(void)
-{
-}
-
 #if SOC_I2S_LCD_I80_VARIANT
 #include "driver/i2s.h"
 

+ 4 - 3
components/esp_lcd/test_apps/rgb_lcd/main/CMakeLists.txt

@@ -1,6 +1,7 @@
 set(srcs "test_app_main.c"
          "test_rgb_panel.c")
 
-idf_component_register(SRCS ${srcs})
-
-target_link_libraries(${COMPONENT_LIB} INTERFACE "-u test_app_include_rgb_lcd")
+# In order for the cases defined by `TEST_CASE` to be linked into the final elf,
+# the component can be registered as WHOLE_ARCHIVE
+idf_component_register(SRCS ${srcs}
+                       WHOLE_ARCHIVE)

+ 0 - 4
components/esp_lcd/test_apps/rgb_lcd/main/test_rgb_panel.c

@@ -23,10 +23,6 @@
 
 #define TEST_IMG_SIZE (100 * 100 * sizeof(uint16_t))
 
-void test_app_include_rgb_lcd(void)
-{
-}
-
 static esp_lcd_panel_handle_t test_rgb_panel_initialization(bool stream_mode, esp_lcd_rgb_panel_frame_trans_done_cb_t cb, void *user_data)
 {
     esp_lcd_panel_handle_t panel_handle = NULL;

+ 4 - 3
components/esp_lcd/test_apps/spi_lcd/main/CMakeLists.txt

@@ -1,6 +1,7 @@
 set(srcs "test_app_main.c"
          "test_spi_lcd_panel.c")
 
-idf_component_register(SRCS ${srcs})
-
-target_link_libraries(${COMPONENT_LIB} INTERFACE "-u test_app_include_spi_lcd")
+# In order for the cases defined by `TEST_CASE` to be linked into the final elf,
+# the component can be registered as WHOLE_ARCHIVE
+idf_component_register(SRCS ${srcs}
+                       WHOLE_ARCHIVE)

+ 0 - 4
components/esp_lcd/test_apps/spi_lcd/main/test_spi_lcd_panel.c

@@ -18,10 +18,6 @@
 
 #define TEST_SPI_HOST_ID  SPI2_HOST
 
-void test_app_include_spi_lcd(void)
-{
-}
-
 void test_spi_lcd_common_initialize(esp_lcd_panel_io_handle_t *io_handle, esp_lcd_panel_io_color_trans_done_cb_t on_color_trans_done,
                                     void *user_data, int cmd_bits, int param_bits, bool oct_mode)
 {