# STM32 Bootloader Integration Tests CMakeLists.txt
cmake_minimum_required(VERSION 3.22)
project(bootloader_integration_tests C)

set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED ON)

# 启用所有警告
if(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang")
    add_compile_options(-Wall -Wextra -Wpedantic)
endif()

# 集成测试
add_executable(test_integration integration/test_integration.c)

# 注册测试
enable_testing()
add_test(NAME Integration_Test COMMAND test_integration)

# 自定义目标：运行集成测试
add_custom_target(run_integration_tests
    COMMAND ${CMAKE_CTEST_COMMAND} -R Integration_Test --output-on-failure
    DEPENDS test_integration
    COMMENT "Running integration tests..."
)
