When writing unit tests, it is often handy to be able to have access to private data members of an object.
(I know some die-hard unit testers advocate that you should test only via the public interface, but I think a more pragmatic approach makes more sense)
The way I do this is by conditionally disabling the private: keyword when unit testing
#ifndef unitTesting private: #endif
and then a build flag in platformio.ini can activate this:
build_flags = -D unitTesting
To avoid forgetting to disable this access in normal (production) builds, it would be better if there would be separate build flags for the test builds.
So here is my request for a
test_build_flags = -D unitTesting
Thank you Pio team!