Files
fantemp/test/CMakeLists.txt
BlackMark cde7e60170 test: the image's size stops being a number nobody holds
Every other port in the fleet states its image size and is held to it; this
one stated none, so a library advance could move the firmware and no check
would say a word. 8380 B is what the presets build today, byte-identical
between the two modes, and the README now says so.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-16 19:21:29 +02:00

28 lines
1.3 KiB
CMake

libavr_format_test()
# The image must stay below the boot section at 0x7e00, and the README states
# what it measures; a library advance that moves it says nothing on its own.
libavr_size_claim_test(fantemp 8380)
# The battery is a compile: a static_assert that fails is the failure. It is a
# target rather than only a ctest so a plain build catches a regression too.
add_library(consteval_tests OBJECT consteval.cpp)
target_include_directories(consteval_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../src)
target_link_libraries(consteval_tests PRIVATE libavr)
add_test(NAME fantemp.consteval
COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target consteval_tests)
# The board has no reset line and no programming header, so the loader-entry
# route in the emitted image is the only thing standing between a firmware change
# and an unreflashable board.
find_package(Python3 COMPONENTS Interpreter)
if(Python3_FOUND)
add_test(NAME fantemp.reachability
COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/check_reachability.py
--objdump ${CMAKE_OBJDUMP} --elf $<TARGET_FILE:fantemp>
--image $<TARGET_FILE_DIR:fantemp>/fantemp.bin)
else()
message(STATUS "Python not found - the reachability check is skipped")
endif()