How to update Unity to v2.6.0

I just noticed that the PlatformIO registry has v2.5.2 which is now older than the latest v2.6.0 GitHub release.

How do I request an update on the registry? There’s a bug that got fixed in the newer release.

You can update to any particular version as described here

The default behavior is to include this version

but the PIO registery hasn’t been updated for a long time, only sporting 2.5.2 instead of 2.6.0:

https://registry.platformio.org/libraries/throwtheswitch/Unity/versions

In this case, you need to follow the technique for a custom Unity library:

https://docs.platformio.org/en/latest/advanced/unit-testing/frameworks/custom/examples/custom_unity_library.html#unit-testing-frameworks-custom-examples-unity-library

but instead use a custom runner of

from platformio.public import UnityTestRunner

class CustomTestRunner(UnityTestRunner):

    # Use custom version
    EXTRA_LIB_DEPS = ["https://github.com/ThrowTheSwitch/Unity/archive/refs/tags/v2.6.0.zip"]
2 Likes

Proof:

> pio test -vvv -e native
Collected 2 tests (test_desktop, test_embedded)

Processing test_desktop in native environment
-------------------------------Building...
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 2 compatible libraries
Scanning dependencies...
Dependency Graph
|-- Unity @ 2.6.0 (License: MIT, URI: https://github.com/ThrowTheSwitch/Unity/archive/refs/tags/v2.6.0.zip, Path: C:\Users\Max\temp\unity_26\.pio\libdeps\native\Unity)
Building in test mode


Testing...
test\test_desktop\test_main.cpp:19:simple_test:PASS

-----------------------
1 Tests 0 Failures 0 Ignored
OK

-----------------test_desktop [PASSED] Took 1.17 seconds -----------

See

CC @ivankravets for updating https://registry.platformio.org/libraries/throwtheswitch/Unity/versions to latest 2.6.0 release, this is already tracked in

2 Likes

Thanks a lot for your help!

Implemented in

Please re-test with pio upgrade --dev.

2 Likes