-
-
Notifications
You must be signed in to change notification settings - Fork 845
Description
The PlatformIO unity test runner brings in throwtheswitch/Unity@^2.6.0. When this is built, the platformio-build.py script in the library searches the list of project related directories for an instance of unity_config.h. This should be either the default generated unity_config.h file in .pio/build/lolin_s2_mini/unity_config, or one that the user places in or under the test directory.
But there is a bug in the platformio-build.py file where it pre-pends the directory for every instance of unity_config.h. This means that the last directory found with a unity_config.h is the one that is used.
If, for example, you are using the libraries for the esp32s2, the build of libUtil.a will use the unity_config.h found in .platformio/packages/framework-arduinoespressif32/tools/sdk/esp32s2/include/unity/include
This has the result of pulling in object files from the libunity.a in the framework library, and with the esp32s2, sending the test output to stdout (going to the embedded UART) instead of the USB as is usually desired. I will include some additional details in a further addition to the issue.
The fix to the platformio-builder script is simple, and has a PR at ThrowTheSwitch/Unity#817
However to roll out the fix seems more challenging. A new version of Unity is needed. Either a new release of Unity (whenever that happens?) which needs at least one other fix to the library.json file. Or perhaps custom patched version at a platformio/Unity
There doesn't seem to be any reasonable way for platformIO to apply patches to libraries as they are pulled in (?)