- Removed unnecessary calls to relay_chn_create and g_is_component_initialized in multiple test cases across test_relay_chn_core_single.c, test_relay_chn_listener_multi.c, and test_relay_chn_listener_single.c. - Introduced new test files for NVS functionality: test_relay_chn_nvs_multi.c and test_relay_chn_nvs_single.c, covering initialization, direction setting, invalid parameters, and erase operations. - Updated partition table configuration to support NVS storage, including the addition of a new partition file part_nvs.csv. - Adjusted sdkconfig files to enable NVS support and configure custom partition settings for relay channels.
43 lines
1.2 KiB
CMake
43 lines
1.2 KiB
CMake
# === These files must be included in any case ===
|
|
set(srcs "test_common.c"
|
|
"test_app_main.c")
|
|
|
|
set(incdirs ".")
|
|
|
|
# === Selective compilation based on channel count ===
|
|
if(CONFIG_RELAY_CHN_COUNT GREATER 1)
|
|
list(APPEND srcs "test_relay_chn_core_multi.c"
|
|
"test_relay_chn_listener_multi.c")
|
|
else()
|
|
list(APPEND srcs "test_relay_chn_core_single.c"
|
|
"test_relay_chn_listener_single.c")
|
|
endif()
|
|
|
|
if(CONFIG_RELAY_CHN_ENABLE_TILTING)
|
|
if(CONFIG_RELAY_CHN_COUNT GREATER 1)
|
|
list(APPEND srcs "test_relay_chn_tilt_multi.c")
|
|
else()
|
|
list(APPEND srcs "test_relay_chn_tilt_single.c")
|
|
endif()
|
|
endif()
|
|
|
|
if(CONFIG_RELAY_CHN_ENABLE_NVS)
|
|
list(APPEND incdirs "../../private_include")
|
|
list(APPEND srcs "../../src/relay_chn_nvs.c")
|
|
if(CONFIG_RELAY_CHN_COUNT GREATER 1)
|
|
list(APPEND srcs "test_relay_chn_nvs_multi.c")
|
|
else()
|
|
list(APPEND srcs "test_relay_chn_nvs_single.c")
|
|
endif()
|
|
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}
|
|
INCLUDE_DIRS ${incdirs}
|
|
REQUIRES unity relay_chn
|
|
WHOLE_ARCHIVE
|
|
)
|