Open dzid26 opened 1 year ago
Hmm, I noticed UNITY_INCLUDE_CONFIG_H
appears in c_cpp_properties.json
when unit testing env is selected. I guess I would prefer for it to be added if a single test is detected in the workspace.
Conversely .pio/libdeps/XXX_env/Unity/src"
is added to c_cpp_properties.json
for any env, as long as that directory was created and matches env name.
So this include may be defined or not, depending on whether the testing was done for a given env in the past.
For me my default env is a release one and it ignores all the tests. Without a path definition to unity.h, no function gets resolved by Intelisense in unit tests.
I don't know, but to me, it would be better if .platformio\packages\tool-unity
and the unit testing definition could be added to c_cpp_properties.json
if there is at least one test detected.
Have you tried to test a project? It will pull all dependencies. Restart VSCode.
Yes, I go through all my envs using VScode sidebar unittester. It pulls unity sources into here:
That's works, although, for the release env I have test_ignore = *
, so I need to temporarily fake that I am doing the test in order to pull Unity and for the path to libdeps/xxx_release/Unity/src
to appear in c_cpp_properties.json
to appear.
But that's only this one path define. Others, i.e. UNITY_INCLUDE_CONFIG_H
and path to unity_config.h
don't appear automatically for the release.
I don't like to switch away from the release though, because then Upload button becomes useless.
I can't get UNITY_INCLUDE_CONFIG_H
to appear c_cpp_properties.json
anymore even by switching env to unit test one. Maybe it was never there.
Could you provide a simple project (as a ZIP archive attached to this issue) to reproduce this issue?
What kind of issue is this?
[x] Feature Request.
PlatformIO Version (
platformio --version
): PlatformIO Core, version 6.1.9Description of the problem
c_cpp_properties.json
already has test related Unity path.pio/libdeps/Release/Unity/src",
. I think it should also have the UNITY_INCLUDE_CONFIG_H and the include path definition.I use
unity_config.h
to define some common top-level features:Because this is not linked by IntelliSense some functions in unit test are not resolved:
Or.
Of course, I can include everything in each test, but
unity_config.h
seems like a better central place.