Hello,
We are mocking our code but we are having difficulties eliminating the dependency of other files the mocked file includes due to the mocked header including the original header which includes several other files.
The error we are getting below:
In file included from ../nRF5_SDK_11.0.0_89a8197/components/softdevice/s130/headers/ble_gap.h:48:0,
from ../nRF5_SDK_11.0.0_89a8197/components/softdevice/s130/headers/ble.h:52,
from ../infrastructure/microcontroller_abstraction/ble/include/ble_service.h:4,
from ../infrastructure/system_abstraction/pressure/include/pressure_service.h:15,
from ./mocks/pressure_service_mock.h:5,
from ./mocks/pressure_service_mock.c:7:
../nRF5_SDK_11.0.0_89a8197/components/softdevice/s130/headers/ble_gap.h: In function 'sd_ble_gap_address_set':
../nRF5_SDK_11.0.0_89a8197/components/softdevice/s130/headers/nrf_svc.h:66:5: error: unknown register name 'r0' in 'asm'
__asm( \
^
It is due to the following sample scenario:
lets take a sample file pressure service mock.c for example
the mock.c ---- includes ---> mock.h
the thing is, since mock.h is generated, it is including the the pressure_service.h
and since we are including the pressure_service.h , it is trying to include the ble_service.h
and then up the hierarchy of includes
the c files of the original SDK is NOT compiled
but the header files have to be included
how would we stop Cmock from including the pressure_service.h?
Please assist i believe this is a generic problem and it is the whole purpose of why one would utilize CMOCK, but we cannot seem to find the solution.