Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Mocking nrf_gpio.h with Ceedling, Unity + FFF (Fake Function Framework)

I am trying to using ceedling with FFF to create mocks of some of the NRFX HAL files. However, when I run ceedling I get some very weird errors. I've taken the `test/include` file from the nRF5 Mesh SDK and I'm not getting compilation errors anymore, but I'm getting a warning that there are no prototypes defined in the file nrf_gpio.h. I saw from a previous question that I need to define HOST and SUPPRESS_INLINE_IMPLEMENTATION, which I have done, but I still get the warning.

I can see in my build folder that the cached nrf_gpio.h file has prototypes all marked as static inline, so I would think it should be creating the mocks accordingly. Does anyone have any experience with this?

Here is my ceedling project.yml configuration file.

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
---
# Notes:
# As such, release build options are disabled.
# This sample, therefore, only demonstrates running a collection of unit tests.
:project:
:use_exceptions: FALSE
:use_test_preprocessor: TRUE
:use_auxiliary_dependencies: TRUE
:build_root: ceedling_build
:test_file_prefix: test_
:which_ceedling: vendor/ceedling
:default_tasks:
- test:all
:environment:
- :mcu: NRF52810_XXAA
- :sdk_root: nRF5_SDK_16.0.0
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX