Files
ninlight-w600/test/CMakeLists.txt
T
Michael Sauer 91721ac47d feat: Flash-HAL-Interface und Settings-Store mit A/B-Slots
Implementiert:
- Flash HAL (nl_flash_read/write/erase_sector) Interfaces
- Flash Layout mit A/B-Settings Slots und weiteren Regions
- Test-Fake für Flash mit Fehlerinjection (Stromausfall-Simulation)
- Settings-Store mit CRC32 Recovery und Slot-Alternierung
- Vollständige Test-Suite mit Corruption/Power-Loss-Tests
2026-09-11 13:24:52 +02:00

34 lines
1.4 KiB
CMake

cmake_minimum_required(VERSION 3.20)
project(ninlight_host_tests C)
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED ON)
include(FetchContent)
FetchContent_Declare(unity
GIT_REPOSITORY https://github.com/ThrowTheSwitch/Unity.git
GIT_TAG v2.6.0)
FetchContent_MakeAvailable(unity)
enable_testing()
set(NL_SRC ${CMAKE_CURRENT_SOURCE_DIR}/../src)
function(nl_test name)
add_executable(${name} ${ARGN})
target_include_directories(${name} PRIVATE ${NL_SRC} ${CMAKE_CURRENT_SOURCE_DIR})
target_compile_options(${name} PRIVATE -Wall -Wextra -Werror)
target_compile_definitions(${name} PRIVATE NINLIGHT_HOST_TEST=1)
target_link_libraries(${name} PRIVATE unity m)
add_test(NAME ${name} COMMAND ${name})
endfunction()
nl_test(test_sha256 test_sha256.c ${NL_SRC}/util/nl_sha256.c)
nl_test(test_crc test_crc.c ${NL_SRC}/util/nl_crc.c)
nl_test(test_board test_board.c ${NL_SRC}/board/nl_board.c)
nl_test(test_color test_color.c ${NL_SRC}/light/nl_color.c)
nl_test(test_engine test_engine.c ${NL_SRC}/light/nl_engine.c ${NL_SRC}/light/nl_color.c)
nl_test(test_boot_state test_boot_state.c ${NL_SRC}/light/nl_boot_state.c ${NL_SRC}/board/nl_board.c)
nl_test(test_control test_control.c ${NL_SRC}/light/nl_control.c ${NL_SRC}/light/nl_boot_state.c
${NL_SRC}/light/nl_engine.c ${NL_SRC}/light/nl_color.c ${NL_SRC}/board/nl_board.c)
nl_test(test_settings test_settings.c fake_flash.c ${NL_SRC}/config/nl_settings.c ${NL_SRC}/util/nl_crc.c)