Including Preprocessor Directives in Unity/CMock

We have unit testing working with the Zephyr Unity/CMock setup, however the test runner (test_runner_generate) ignores preprocessor directives (#ifdef) and removes them when creating the runner_x.c file. This leads to the runner_x.c file including both the #ifdef and #else lines. 

We tried to modify the unity_cfg.yaml file with the line below as specified in the Ceedling documentation (https://github.com/ThrowTheSwitch/Ceedling/blob/master/docs/CeedlingPacket.md) but it had no effect.

:project:
  :use_test_preprocessor: TRUE
Is there another setting that can be configured, and are the Ceedling settings even available for the Unity/CMock framework available?
NCS Version: 2.4.2
Parents Reply
  • If you mean the unity_cfg.yml, then yes, this file is being parsed correctly. I've added a project.yml file it in a variety of places and it is not being parsed. 

    The unity_cfg.yml file is listed in the cmake in nrf/unity/tests, but there is no reference to a project.yml. Is the framework even looking for a project.yml?

    Are these settings (i.e. use_test_preprocessor, use_preprocessor_directives) even available this test framework? Does this framework have all the features as Ceedling? github.com/.../CeedlingPacket.md

    Thanks

Children
Related