You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Most ESP-IDF APIs are written in C, so googletest can't be used to mock them. We have to use link time substitution to mock the C APIs. Some options:
Wrap up the C API in a C++ API which can be mocked with googletest. This would be tightly coupled to the low level ESP-IDF component, unlike the wrapper which abstract ESP-IDF away. Then we can test the higher layer by mocking this low level wrapper. Even if we did this, then we might want to test the low level wrapper in some way, so this is not a solution.
https://github.com/meekrosoft/fff to mock the methods. The mock generation macros don't work in C++, and if used with C, then we can't easily test the wrapper's API which is C++.
http://www.throwtheswitch.org/ceedling automates generating the mock C functions and also includes methods to set up expectations on calls. Might be easier to get going than cpputest.
Most ESP-IDF APIs are written in C, so googletest can't be used to mock them. We have to use link time substitution to mock the C APIs. Some options:
https://stackoverflow.com/questions/14233853/c-unit-testing-and-stubbing-a-3rd-party-c-library
The text was updated successfully, but these errors were encountered: