Skip to content

PlatformIO build of Unity may include the wrong unity_config.h #816

@jmwanderer

Description

@jmwanderer

🍍 🐝
PlatformIO-core imports and builds libUnity v2.6.0 in the unity testing framework.

PlatformIO uses the platformio-build.py script to configure the include path for building by searching the candidate include directories in priority order, finding a unity_config.h, and pre-pending that directory to the include path used when building unity.c

However platformio-build.py doesn't stop when it finds a unity_config.h. It continues and pre-pends directories to the include path as it finds other copies of unity_config.h. This results in the lowest priority directory being first on the list.

A concrete example is the espressiff32 libraries for the ESP32 series processors contain a unity_config.h which gets used in favor of the default generated by the PlatformIO system or any custom file the user / developer puts in place.

The fix is simple, just break after the first occurrence is found.

This change could surprise any existing users whose unit test environments are working using the framework libraries.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions