Files
relay_chn/test_apps/main/CMakeLists.txt
ismail 5e8e5a4cab Add notification system for relay channel state changes
- Introduced a new notification module to handle state change listeners.
- Added functions to register and unregister listeners for relay channel state changes.
- Implemented a queue-based system to manage notifications and listener callbacks.
- Updated core relay channel logic to utilize the new notification system.
- Removed old listener management code from relay channel core.
- Refactored the former listener tests to notify tests and added tests for the notification system, including handling of multiple listeners and queue overflow scenarios.
- Updated CMakeLists.txt to include new source files and headers for the notification module.
- Revised README.md to include warnings about callback execution context and performance considerations.

Refs #1096, #1085 and closes #1097
2025-09-02 15:46:48 +03:00

44 lines
1.2 KiB
CMake

# === These files must be included in any case ===
set(srcs "test_common.c"
"test_relay_chn_notify_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_notify_multi.c")
else()
list(APPEND srcs "test_relay_chn_core_single.c"
"test_relay_chn_notify_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
)