PlatformIO Community

Unity TEST_MESSAGE() not available when target unit testing

After reading Tracing inside of unit tests
I started using this, and it works fine for native/desktop unit tests, but it is not available for target unit tests, at least not in my setup.
Checking on which unity.h files are used in both scenarios, I’ve found some differences:

on my Windows10 this is the path for unity.h
Screen Shot 02-02-22 at 09.30 AM

and here is the definition for TEST_MESSAGE
Screen Shot 02-02-22 at 09.30 AM 001

on the target (ESP32 in my case) this is the path
Screen Shot 02-02-22 at 09.28 AM
and there is no definition of TEST_MESSAGE
Screen Shot 02-02-22 at 09.29 AM

I have Espressif32 platform updated to V3.5.0

Does anyone have a solution for this ?

Frameworks which have include their own copy of Unity are problematic, because really PlatformIO wants that its own Unity version is included. I’ve already reported an issue related to this in https://github.com/platformio/platformio-core/issues/3980, which occurs when there’s pre-definition / precompiled version of the Unity functions. Your problem seems to be slightly different however (otherwise you would have run into this linking error long before), in regards to that a #include <unity.h> picks up the wrong version. I think this shoud be reported as a seperate issue in https://github.com/platformio/platformio-core/issues (the core because it can potentially occur not only in platform-espressif32 but also other frameworks).

Ok, Issue #4175 created