Skip to content

Commit

Permalink
Merge branch 'feature/trim_the_build_of_test_apps_of_esp_adc' into 'm…
Browse files Browse the repository at this point in the history
…aster'

Trim the build components

Closes IDF-7459

See merge request espressif/esp-idf!24143
  • Loading branch information
suda-morris committed Jun 13, 2023
2 parents b9cc4f0 + 6c9cf5c commit f38945e
Show file tree
Hide file tree
Showing 64 changed files with 130 additions and 7 deletions.
3 changes: 3 additions & 0 deletions components/driver/test_apps/analog_comparator/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# This is the project CMakeLists.txt file for the test subproject
cmake_minimum_required(VERSION 3.16)

# "Trim" the build. Include the minimal set of components, main, and anything it depends on.
set(COMPONENTS main)

include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(test_ana_cmpr)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ endif()

idf_component_register(SRCS ${srcs}
INCLUDE_DIRS "."
PRIV_REQUIRES unity driver
WHOLE_ARCHIVE)
3 changes: 3 additions & 0 deletions components/driver/test_apps/dac_test_apps/dac/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# This is the project CMakeLists.txt file for the test subproject
cmake_minimum_required(VERSION 3.16)

# "Trim" the build. Include the minimal set of components, main, and anything it depends on.
set(COMPONENTS main)

include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(dac_test)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ endif()
# 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 unity driver esp_adc
WHOLE_ARCHIVE)
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# This is the project CMakeLists.txt file for the test subproject
cmake_minimum_required(VERSION 3.16)

# "Trim" the build. Include the minimal set of components, main, and anything it depends on.
set(COMPONENTS main)

include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(dac_legacy_test)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ set(srcs "test_app_main.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 unity driver esp_event esp_adc
WHOLE_ARCHIVE)
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand All @@ -13,9 +13,7 @@
#include "unity_test_utils.h"
#include "esp_system.h"
#include "esp_event.h"
#include "esp_wifi.h"
#include "esp_log.h"
#include "nvs_flash.h"
#include "soc/soc_caps.h"
#define CONFIG_ADC_SUPPRESS_DEPRECATE_WARN 1
#include "driver/adc.h"
Expand Down
3 changes: 3 additions & 0 deletions components/driver/test_apps/gpio/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# This is the project CMakeLists.txt file for the test subproject
cmake_minimum_required(VERSION 3.16)

# "Trim" the build. Include the minimal set of components, main, and anything it depends on.
set(COMPONENTS main)

include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(gpio_test)

Expand Down
1 change: 1 addition & 0 deletions components/driver/test_apps/gpio/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ endif()
# 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 unity driver spi_flash
WHOLE_ARCHIVE)
3 changes: 3 additions & 0 deletions components/driver/test_apps/gpio_extensions/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# This is the project CMakeLists.txt file for the test subproject
cmake_minimum_required(VERSION 3.16)

# "Trim" the build. Include the minimal set of components, main, and anything it depends on.
set(COMPONENTS main)

include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(gpio_extension_test)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ endif()
# 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 unity driver
WHOLE_ARCHIVE)
3 changes: 3 additions & 0 deletions components/driver/test_apps/gptimer/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# This is the project CMakeLists.txt file for the test subproject
cmake_minimum_required(VERSION 3.16)

# "Trim" the build. Include the minimal set of components, main, and anything it depends on.
set(COMPONENTS main)

include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(gptimer_test)

Expand Down
1 change: 1 addition & 0 deletions components/driver/test_apps/gptimer/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ endif()
# 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 unity driver
WHOLE_ARCHIVE)
3 changes: 3 additions & 0 deletions components/driver/test_apps/i2c/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# This is the project CMakeLists.txt file for the test subproject
cmake_minimum_required(VERSION 3.16)

# "Trim" the build. Include the minimal set of components, main, and anything it depends on.
set(COMPONENTS main)

set(EXTRA_COMPONENT_DIRS
"$ENV{IDF_PATH}/tools/unit-test-app/components"
)
Expand Down
1 change: 1 addition & 0 deletions components/driver/test_apps/i2c/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ set(srcs "test_app_main.c"
)

idf_component_register(SRCS ${srcs}
PRIV_REQUIRES unity driver test_utils
WHOLE_ARCHIVE)
3 changes: 3 additions & 0 deletions components/driver/test_apps/i2s_test_apps/i2s/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# This is the project CMakeLists.txt file for the test subproject
cmake_minimum_required(VERSION 3.16)

# "Trim" the build. Include the minimal set of components, main, and anything it depends on.
set(COMPONENTS main)

include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(i2s_test)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ set(srcs "test_app_main.c"
"test_i2s_iram.c")

idf_component_register(SRCS ${srcs}
PRIV_REQUIRES unity driver spi_flash
WHOLE_ARCHIVE)
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
# in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.16)

# "Trim" the build. Include the minimal set of components, main, and anything it depends on.
set(COMPONENTS main)

set(EXTRA_COMPONENT_DIRS
"$ENV{IDF_PATH}/tools/unit-test-app/components"
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
idf_component_register(SRCS "test_app_main.c" "test_i2s_tdm_full_duplex.c"
PRIV_REQUIRES unity driver test_utils
INCLUDE_DIRS "."
WHOLE_ARCHIVE
)
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# This is the project CMakeLists.txt file for the test subproject
cmake_minimum_required(VERSION 3.16)

# "Trim" the build. Include the minimal set of components, main, and anything it depends on.
set(COMPONENTS main)

include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(i2s_adc_dac_test)
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ set(srcs "test_app_main.c"
"test_i2s_dac.c")

idf_component_register(SRCS ${srcs}
PRIV_REQUIRES unity driver esp_event esp_adc
WHOLE_ARCHIVE)
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
#include "unity.h"
#include "esp_system.h"
#include "esp_event.h"
#include "esp_wifi.h"
#include "esp_log.h"
#include "nvs_flash.h"
#include "esp_rom_sys.h"

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@
#include "unity.h"
#include "esp_system.h"
#include "esp_event.h"
#include "esp_wifi.h"
#include "esp_log.h"
#include "nvs_flash.h"
#include "test_dac_audio_file.h"
#include "driver/i2s.h"
#include "driver/dac.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# This is the project CMakeLists.txt file for the test subproject
cmake_minimum_required(VERSION 3.16)

# "Trim" the build. Include the minimal set of components, main, and anything it depends on.
set(COMPONENTS main)

include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(i2s_legacy_test)
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ set(srcs "test_app_main.c"
"test_legacy_i2s.c")

idf_component_register(SRCS ${srcs}
PRIV_REQUIRES unity driver
WHOLE_ARCHIVE)
3 changes: 3 additions & 0 deletions components/driver/test_apps/ledc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# This is the project CMakeLists.txt file for the test subproject
cmake_minimum_required(VERSION 3.16)

# "Trim" the build. Include the minimal set of components, main, and anything it depends on.
set(COMPONENTS main)

include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(ledc_test)

Expand Down
1 change: 1 addition & 0 deletions components/driver/test_apps/ledc/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ set(srcs "test_app_main.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 unity driver esp_timer
WHOLE_ARCHIVE)
3 changes: 3 additions & 0 deletions components/driver/test_apps/legacy_adc_driver/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# This is the project CMakeLists.txt file for the test subproject
cmake_minimum_required(VERSION 3.16)

# "Trim" the build. Include the minimal set of components, main, and anything it depends on.
set(COMPONENTS main)

include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(legacy_adc_driver_test)
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ set(srcs "test_app_main.c"
"test_legacy_adc.c")

idf_component_register(SRCS ${srcs}
PRIV_REQUIRES unity driver
WHOLE_ARCHIVE)
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# This is the project CMakeLists.txt file for the test subproject
cmake_minimum_required(VERSION 3.16)

# "Trim" the build. Include the minimal set of components, main, and anything it depends on.
set(COMPONENTS main)

include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(legacy_mcpwm_driver_test)
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ set(srcs "test_app_main.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 unity driver
WHOLE_ARCHIVE)
3 changes: 3 additions & 0 deletions components/driver/test_apps/legacy_pcnt_driver/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# This is the project CMakeLists.txt file for the test subproject
cmake_minimum_required(VERSION 3.16)

# "Trim" the build. Include the minimal set of components, main, and anything it depends on.
set(COMPONENTS main)

include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(legacy_pcnt_driver_test)
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ set(srcs "test_app_main.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 unity driver
WHOLE_ARCHIVE)
3 changes: 3 additions & 0 deletions components/driver/test_apps/legacy_rmt_driver/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# This is the project CMakeLists.txt file for the test subproject
cmake_minimum_required(VERSION 3.16)

# "Trim" the build. Include the minimal set of components, main, and anything it depends on.
set(COMPONENTS main)

include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(legacy_rmt_test)
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ set(srcs "test_app_main.c"
"test_legacy_rmt.c")

idf_component_register(SRCS ${srcs}
PRIV_REQUIRES unity driver infrared_tools
WHOLE_ARCHIVE)
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# This is the project CMakeLists.txt file for the test subproject
cmake_minimum_required(VERSION 3.16)

# "Trim" the build. Include the minimal set of components, main, and anything it depends on.
set(COMPONENTS main)

include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(legacy_rtc_temp_driver_test)
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ set(srcs "test_app_main.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 unity driver
WHOLE_ARCHIVE)
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# This is the project CMakeLists.txt file for the test subproject
cmake_minimum_required(VERSION 3.16)

# "Trim" the build. Include the minimal set of components, main, and anything it depends on.
set(COMPONENTS main)

include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(legacy_timer_driver_test)
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ set(srcs "test_app_main.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 unity driver
WHOLE_ARCHIVE)
3 changes: 3 additions & 0 deletions components/driver/test_apps/mcpwm/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# This is the project CMakeLists.txt file for the test subproject
cmake_minimum_required(VERSION 3.16)

# "Trim" the build. Include the minimal set of components, main, and anything it depends on.
set(COMPONENTS main)

include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(mcpwm_test)

Expand Down
1 change: 1 addition & 0 deletions components/driver/test_apps/mcpwm/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ endif()
# 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 unity driver
WHOLE_ARCHIVE)
3 changes: 3 additions & 0 deletions components/driver/test_apps/parlio/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# This is the project CMakeLists.txt file for the test subproject
cmake_minimum_required(VERSION 3.16)

# "Trim" the build. Include the minimal set of components, main, and anything it depends on.
set(COMPONENTS main)

include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(parlio_test)

Expand Down
1 change: 1 addition & 0 deletions components/driver/test_apps/parlio/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ set(srcs "test_app_main.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 unity driver
WHOLE_ARCHIVE)
3 changes: 3 additions & 0 deletions components/driver/test_apps/pulse_cnt/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# This is the project CMakeLists.txt file for the test subproject
cmake_minimum_required(VERSION 3.16)

# "Trim" the build. Include the minimal set of components, main, and anything it depends on.
set(COMPONENTS main)

include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(pcnt_test)

Expand Down
1 change: 1 addition & 0 deletions components/driver/test_apps/pulse_cnt/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ endif()
# 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 unity driver spi_flash
WHOLE_ARCHIVE)
3 changes: 3 additions & 0 deletions components/driver/test_apps/rmt/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# This is the project CMakeLists.txt file for the test subproject
cmake_minimum_required(VERSION 3.16)

# "Trim" the build. Include the minimal set of components, main, and anything it depends on.
set(COMPONENTS main)

include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(rmt_test)

Expand Down
1 change: 1 addition & 0 deletions components/driver/test_apps/rmt/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ if(CONFIG_RMT_ISR_IRAM_SAFE)
endif()

idf_component_register(SRCS "${srcs}"
PRIV_REQUIRES unity driver esp_timer
WHOLE_ARCHIVE)
3 changes: 3 additions & 0 deletions components/driver/test_apps/rs485/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# This is the project CMakeLists.txt file for the test subproject
cmake_minimum_required(VERSION 3.16)

# "Trim" the build. Include the minimal set of components, main, and anything it depends on.
set(COMPONENTS main)

set(EXTRA_COMPONENT_DIRS "$ENV{IDF_PATH}/tools/unit-test-app/components")

include($ENV{IDF_PATH}/tools/cmake/project.cmake)
Expand Down
Loading

0 comments on commit f38945e

Please sign in to comment.