I'm starting to look at using Ceedling (+Unity + CMock) for some test driven development but am having trouble getting tests that use/mock the SDK. I'm currently trying to set up unit tests for a custom ble service (an SDK equivalent would be any of the files in the components\ble\ble_services folder) that will run on my PC, not on the target. I am using Cygwin and gcc
Does anyone have any experience/guidance/project files for how to set this up?
My current yml file looks like this
I am using python to extract include paths and defines from my Keil project file and generate another yml file that I include when running ceedling e.g.
ceedling options:NRF52_S332_SDK153 test:all
this is so i can run tests for each of the targets for my project.
I'm currently stuck with errors like
../libnordic/v15.3/components/softdevice/s332/headers/ble.h: In function 'sd_ble_user_mem_reply':
../libnordic/v15.3/components/softdevice/s332/headers/nrf_svc.h:68:5: error: unknown register name 'r0' in 'asm'
__asm( \
^
.
I have included mock_ble.h in my test file.
#include "unity.h" #include "ble_my_service.h" #include "mock_ble.h" #include "mock_ble_gap.h" void setUp(void) { } void tearDown(void) { } void test_ble_my_service_NeedToImplement(void) { TEST_IGNORE_MESSAGE("Need to Implement ble_my_service"); }
How can I get this going? Should this work? Am I trying to mock things at too low of a level? Am I using the right compiler tools?