Unity outdated?

I’m using
⟩ pio --version
PlatformIO, version 4.1.0

When I run
⟩ pio upgrade
You’re up-to-date!
PlatformIO 4.1.0 is currently the newest version available.

I seem up to date. However the files in ~/.platformio/packages/tool-unity seem to be outdated (looking at the copyright header) compared to what can be found at

What I am interested in is if the tools in ~/.platformio/packages/tool-unity can be updated (newer version compatible with pio) and if I can add the Unity functionality described in
Unity/extras/fixture at master · ThrowTheSwitch/Unity · GitHub.

Any thoughts?

Actually also tried to update tools-unity with

pio update tools-unity

I also tried updating the package.json file version int the tools-unity dir manually and then run the above once more. This says it has updated:

⟩ pio update
Updating tool-unity                      @ 2.5.0          [Up-to-date]
... 

but the files are still the same old ones:

⟩ cat unity.h
/* ==========================================
    Unity Project - A Test Framework for C
    Copyright (c) 2007-14 Mike Karlesky, Mark VanderVoord, Greg Williams
    [Released under MIT License. Please refer to license.txt for details]
========================================== */

#ifndef UNITY_FRAMEWORK_H
#define UNITY_FRAMEWORK_H
...

Compared with the latest on GitHub

You can’t force a update just by changing the package.json - in fact, you probably just made it think it had a newer version installed than was available in the PIO package repo, which is basically impossible, so would have just been considered up-to-date.

It looks like PIO is using v2.4.3 of Unity, which has the incorrect header date of 2007-14. 2.5.0 was only released a couple of months ago, and due to the two year gap between releases, probably hasn’t been noticed yet. Maybe you could try an inplace test of it - just backup the existing files ,and try the new ones in the /src/ dir, and see if it breaks. Probably worthy of a feature request issue against the platformio-core given unit testing is a core feature.

Oh, and btw, the upgrade command upgrades the PIO core … it’s the update command you want for updating packages etc… :wink:

  update    Update installed platforms, packages and libraries
  upgrade   Upgrade PlatformIO to the latest version

@pfeerick, due to my familiarity with NPM (node package manager) I just (wrongly) assumed it is handled under the hood by that package manager somehow and ‘why not try this way’ as packages version would be locked with a package-lock.json.

Just tried your suggestion, which unfortunately doesn’t work. It doesn’t break anything either, as the files in tool-unity just get replaced with the originals on a test run. It’s not really a blocker for me, I just wanted to try out some advanced features in extra/ folder of unity. I might get round to adding a feature request or poking around in the pio-core source in the near future.

Thanks for your help!

1 Like

No worries. Thanks for trying it out and posting the FR issue… I was just about to do that! :wink: As I just mentioned in a comment there, the particular feature you’re interested in trying isn’t actually available in a release version of Unity yet - it was introduced in one of the 24 odd commits since the 2.5.0 release, so I don’t fancy your chances until it’s present in a released version of the suite.

1 Like

Updated in the latest PIO Core. Please re-test with $ pio upgrade --dev.

1 Like

@ivankravets thanks for the update.

⟩ pio upgrade --dev
Please wait while upgrading PlatformIO ...
PlatformIO has been successfully upgraded to 4.1.1b9
Release notes: https://docs.platformio.org/en/latest/history.html
...
⟩ pio --version
PlatformIO, version 4.1.1b9
⟩ pio update tool-unity # I know the following is caused by my usage error, but seems to install anyhow...
Please wait while upgrading PlatformIO...
Updating tool-unity                      @ 1.20403.0      [1.20500.0]
Uninstalling tool-unity @ 1.20403.0: 	[OK]
CorePackageManager: Installing tool-unity @ 1.20500.0
tool-unity @ 1.20500.0 has been successfully installed!
Traceback (most recent call last):
  File "/usr/local/bin/pio", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/site-packages/platformio/__main__.py", line 107, in main
    maintenance.on_platformio_exception(e)
  File "/usr/local/lib/python2.7/site-packages/platformio/maintenance.py", line 65, in on_platformio_exception
    telemetry.on_exception(e)
  File "/usr/local/lib/python2.7/site-packages/platformio/telemetry.py", line 316, in on_exception
    send_exception(description, is_fatal)
  File "/usr/local/lib/python2.7/site-packages/platformio/telemetry.py", line 377, in send_exception
    mp = MeasurementProtocol()
  File "/usr/local/lib/python2.7/site-packages/platformio/telemetry.py", line 72, in __init__
    self["cid"] = app.get_cid()
  File "/usr/local/lib/python2.7/site-packages/platformio/app.py", line 390, in get_cid
    cid = get_state_item("cid")
  File "/usr/local/lib/python2.7/site-packages/platformio/app.py", line 328, in get_state_item
    with State() as state:
  File "/usr/local/lib/python2.7/site-packages/platformio/app.py", line 94, in __init__
    self.path = join(get_project_core_dir(), "appstate.json")
  File "/usr/local/lib/python2.7/site-packages/platformio/project/helpers.py", line 51, in get_project_core_dir
    join(get_project_dir(), "platformio.ini")
  File "/usr/local/lib/python2.7/site-packages/platformio/project/helpers.py", line 29, in get_project_dir
    return os.getcwd()
OSError: [Errno 2] No such file or directory
pio update
Updating tool-unity                      @ 1.20500.0      [Up-to-date]
Updating tool-scons                      @ 2.20501.191222 [Up-to-date]

Platform Manager
================
Platform Native
--------
Updating native                          @ 1.1.2          [Up-to-date]


Library Manager
===============
Library Storage: /Users/joustava/.platformio/lib

Looks like it updates. The actual content of tool-unity is updated as well.

However, I was aiming to try out functionality in #include <unity_fixture.h> as described in

I understand if this is not available in their latest release. Plus not a blocker for me. Also, maybe some of the features from extras (fixtures/memory) don’t fit into platformio and are handled differently?

In any case, thanks for platformio! :slight_smile:

1 Like

Please file a feature request here Issues · platformio/platformio-core · GitHub