From 6e179fbac6ee98c836416d8e7c57a7a708497785 Mon Sep 17 00:00:00 2001 From: BlackMark Date: Sun, 16 Aug 2026 19:20:24 +0200 Subject: [PATCH] test: the example'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 `clock` and no check would say a word - which is exactly what the size claim was built after. The two numbers are what the presets build today, byte-identical across generated and reflect, and the README now says both. Co-Authored-By: Claude Opus 5 --- README.md | 4 +++- test/CMakeLists.txt | 8 ++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f753f10..cb9d67d 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,9 @@ cmake --build --preset attiny85-generated Presets cover attiny85/atmega328p in both libavr modes (generated and reflect); `ctest` runs the consteval battery over the BCD, the hours -register's two formats, the weekday and the alarm rate encodings. The legacy +register's two formats, the weekday and the alarm rate encodings, and holds +the example to its stated size — **1480 B** on the mega328P and **1238 B** +on the tiny85, byte-identical across the two modes. The legacy yazoalfa-based driver lives on the `master` branch. The weekday register is derived from the date by default. A program that diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 373b8b6..7274c3f 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,5 +1,13 @@ libavr_format_test() +# The example's size is stated in the README, per chip, and a library advance +# that moves it silently is what this catches. +if(LIBAVR_MCU STREQUAL "atmega328p") + libavr_size_claim_test(clock 1480) +elseif(LIBAVR_MCU STREQUAL "attiny85") + libavr_size_claim_test(clock 1238) +endif() + # 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)