Okay, back to the beginning actually.
You want to unit test the code in
which includes this header file
…which then includes main.hpp which includes…
the entire STM32Hal. So yes, thing you’re trying to unit test is not unit-testable that way.
On the other hand, when I move include/StaticData.hpp to lib/BasicSoftware/StaticData.hpp and replace the #include "main.hpp" with #include <stdint.h> so that uint16_t is found, and I build the firmware
Checking size .pio\build\robotdyn_blackpill_f303cc\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [ ] 0.1% (used 44 bytes from 40960 bytes)
Flash: [ ] 0.4% (used 972 bytes from 262144 bytes)
==================== [SUCCESS] Took 1.90 seconds ====================
it still builds of course, since the firwmare is using the BasicSoftware library and all the files in that folder are automatically in the include path – thus it makes no difference if StaticData.hpp is in include/ or in lib/BasicSoftware.
Further, doing env:testing → Advaned → Test then gives
You just need a bit of decoupling here.
