I'm attempting to mock hardware-dependent IDF components so I can implement unit testing. I'm using IDF v4.3, which has cmock as a component.
I've managed to generate cmock mocks for the driver/touch_sensor.h header file, using the CMakeLists.txt in the spi_flash component for reference. When I include functions from my code under test (that contain #include "driver/touch_sensor.h") in my test cases, I find I get multiple definition errors. This is due to both the presence of original component function definitions, and the mocked versions being present in the executable.
Is there a way of compiling this test, but excluding only the original component that is being mocked, in order to avoid these errors?
Thanks!
Mocking IDF components with Unity & CMock
Re: Mocking IDF components with Unity & CMock
Hello,
I have the exact same issue, does anyone have found a solution for excluding the original IDF component?
Thanks
I have the exact same issue, does anyone have found a solution for excluding the original IDF component?
Thanks
Who is online
Users browsing this forum: No registered users and 126 guests