Zephyr ztest with CMock Integration Problem

Hi all


We are using ztest in our project because it works nicely together with twister, Zephyr's test runner tool. We need to have the ability to mock modules. For this we use CMock, which can be enabled by setting CONFIG_UNITY=y (which is part of nrf-sdk).
The prj.conf file of a typical unit test suite in our project looks like this:

CONFIG_ZTEST=y
CONFIG_UNITY=y

We do not use the Unity Test Runner but ztest with Twister instead. From the unity configuration, only CMock functionality is used.
When testing a module which depends on one or more mocks, execution of the unit test suite will crash with the message *** longjmp causes uninitialized stack frame *** when a mocked function is called. Only when all call expectations match exactly, execution runs until the end.
To sum it up: When a test PASSES everything works well, but if a test FAILS because one or more call expectations do not match, then test execution crashes with the above mentioned message instead of printing the assertion properly.

We're currently on zephyr v2.6 and nrf-sdk v1.6.0.

Any hints on how this can be fixed are greatly appreciated.

best regards

Parents Reply Children
No Data
Related