Intellisense configuration provider 'nordic-semiconductor.nrf-connect' does not provide completions for unit test projects

Completions for symbols in unity.h and custom, common include files (e.g. test_main.h) are not found by intellisense.

c_cpp_properties.json:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"windowsSdkVersion": "10.0.19041.0",
"compilerPath": "cl.exe",
"cStandard": "c17",
"cppStandard": "c++17",
"intelliSenseMode": "windows-msvc-x64",
"configurationProvider": "nordic-semiconductor.nrf-connect"
}
],
"version": 4
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Tried and didn't work:

  • adding the test project as a separate application
  • adding ${workspaceFolder}/test/inc (location of test_main.h) to includePath or browse.path
  • searched for location of unity.h in SDK and toolchain folders came up with no results. Is it a generated file?

    1258.test.zip

Test project attached ^

Parents
  • Hi Tyler

    If you're struggling to find the unity.h files, there are three in the NCS; dependent on what you're using if for: 

    Have you also checked out our Testing with Unity and CMOCK page in the documentation describing how to set up unit test, etc. 

    Best regards,

    Simon

  • Hi,

    The linked resources did not resolve my issue. I am able to build and execute tests successfully. The problem is that the unity.h header, and custom includes in the test files are not recognized by the intellisense provider

    I've tried adding test/cmock/vendor/unity/src to my includePath, but that did not work either.

    In attached sample project (unity-include-errors.zip), observe that in test_mod1.c and test_mod2.c the unity.h and test_main.h includes are not processed correctly by the intellisense provider

    unity-include-errors.zip

Reply
  • Hi,

    The linked resources did not resolve my issue. I am able to build and execute tests successfully. The problem is that the unity.h header, and custom includes in the test files are not recognized by the intellisense provider

    I've tried adding test/cmock/vendor/unity/src to my includePath, but that did not work either.

    In attached sample project (unity-include-errors.zip), observe that in test_mod1.c and test_mod2.c the unity.h and test_main.h includes are not processed correctly by the intellisense provider

    unity-include-errors.zip

Children
No Data